How can I implement a link between a VB6 GUI and a LabWindows DLL, such that while the LW DLL is doing a task, it can periodically update a progress bar in VB?
I believe I have the basic idea:
[VB]
1. Use the 'addressof' operator to send the address of the vb function I want to call from LW (to update the progress bar).
2. Make sure the 'callback' function in VB is in a BAS module.
[LW]
1. Export the function in LW that will be receiving the VB functiion address
2. Generate the DECLARE statement for the exported function to be used by VB.
Am I on the right track here? If so, I'm not sure about the exact syntax to create the DECLARE statement in VB, since it will contain a function pointer in the parameter list.
Also, on the LW side, how is the function pointer variable created? Currently, I'm using "typedef int (*MyFuncPtr) (int iProgress)". Although it compiles, I don't get the correct address from VB.
Do you have a simple example on how to implement this? I would prefer not to have to resort to a full-blown DDE interface for such a simple task.
Regards,
Dan