Re: call_back ?
- Posted by Don <eunexus at yahoo.com> Jul 24, 2004
- 521 views
> Can EU not do this? > ... specifically, this definition for a user defined API 'function' says, *NO* > return > value. > > VOID WINAPI RasDialFunc( > > UINT unMsg, // type of event that has occurred > RASCONNSTATE rasconnstate, // connection state about to be entered > DWORD dwError // error that may have occurred > ); > > Return Values > None. > > .. anyways, it's 'puking' all over me, so I'm.. just wondering, how ?? Actually this doesnt matter one bit as far as EU is concerned. Or any other language. Under all the sugar of high/ mid level languages (even C) you can see from looking at assembly code whats actually happening... 1> you call a function 2> the return value is placed into register EAX (or not) 3> A> if you need the return value you can assign it to a variable from EAX B> if you dont need it just dont do anything and EAX just sits there Everything else doesnt matter. If you assign a return value from a function call you are getting the contents of the EAX register. If you dont need it thats fine. The value is *still* in the EAX register. In other words functions with and without return values are coded the exact same way. If they are coded the same way (which they are), you can go ahead and use your call as a function that *does* return a value. And you can even assign the return to a variable (which in EU is required). Just realise that the value returned will have no meaning because, if they were nice, they zeroed EAX before returning. Its possible they did not touch it however and it would contain whatever just happens to be there before the call happened... Don Phillips - aka Graebel National Instruments mailto: eunexus @ yahoo.com