Reputation: 325
I want to use a DLL in my program which has a function
void Set_Callback(Function Pointer)
The example code inserts a typedef which obiously doesn't work with my VS C++ 2010
typedef void (SET_CALLBACK)(void far pascal (*lpfnPtr)(int));
For this line I get an syntax error '*' and 'function returns function' error.
thanks for your help in advance
Upvotes: 0
Views: 782
Reputation: 4515
It should be
typedef void far pascal (*CallbackType)(Function*);
Upvotes: 0
Reputation: 26181
Its easier to understand and read if you break it into two typedefs:
typedef void (__stdcall * Function)(int);
typedef void (* SETCALLBACK)(Function pf);
in the first typedef, pascal
becomes __stdcall
(as pascal
was for older 16bit systems), and far
can be dropped as it is superfluous in 32/64-bit architectures
Upvotes: 1