12-19-2012 02:00 PM
Background:
I had a CVI executable application that wrapped around a third party DLL. I recently built some LabView modules and wanted to use the features in the CVI code. I stripped out as much as I can from the CVI code and built a DLL out of it, so now its a CVI DLL calling a third party DLL. The third party DLL uses windows messaging to communicate with teh CVI DLL. I did not want to re-write the functions already developed in CVI in LabView (way too much effort).
Problem:
The issue is windows messaging within CVI uses the InstallWinMsgCallback, and ties it to a panel. The events aren't processed until you call RunUserInterface(). RunUserInterface does not return. therefore, any LabView module that loads this DLL will hang, waiting for the DLL to return.
Has anyone developed a CVI DLL, that uses internal callbacks, which can be called from an external process? Does anyone have any ideas of how to get around it?
Solved! Go to Solution.
12-20-2012 06:16 PM
Hi Bjoles,
According to the InstallWinMsgCallback
function help, you can use both RunUserInterface()
and ProcessSystemEvents()
to handle the event. Have you tried using the ProcessSystemEvents()
function? RunUserInterface()
would be expected to simply run until stopped by a call to QuitUserInterface()
, which you did not mention to be a feature of your DLL.
Warm Regards,
12-21-2012 11:49 AM
Daniel,
I actually stumbled upon the same solution before you posted. One thing I did notice however is that it was a bit unpredictable when the message would be received. It turns out that setting the InstallWinMsgCallback to intercept rather than in_queue worked without needing to loop a processsystem events.
-Bryan