01-07-2012 03:09 AM
Hi
I need to recevice progressupdates from a dll. The updates is sent as a callback.
The type def for the function is typedef
void _stdcall (*TProgressHandler)(int ACurrent, int AMax);
And the functioncall to set the handler is:
unsigned __stdcall PSI_SetProgressHandler(TProgressHandler AHandler);
How should the type looks like that i pass to the Create user event structure
Any Idea
BR
Esben
01-07-2012 10:13 AM
You cannot do this purely in LabVIEW because there is no way to get a pointer to a LabVIEW function. You will need to write a wrapper DLL (in C or a compatible language) that contains the callback function, and another function to register that callback that you can call from LabVIEW. The callback function itself should contain code to communicate with LabVIEW, for example by using PostLVUserEvent to trigger a user event. If you search this forum for "dll callback" you'll see that this question has been asked many times.