LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

User Event DLL progress handler

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

0 Kudos
Message 1 of 2
(2,157 Views)

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.

0 Kudos
Message 2 of 2
(2,151 Views)