LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can not trigger the TSQ event callback function

I use CreateProcess() to launch another executable file , the syntax is as : CreateProcess�myexe.exe",myexe NORMAL",NULL,NULL,FALSE,CREATE_DEFAULT_ERROR_MODE|DETACHED_PROCESS,NULL,EGNPATH,&si,&piProcess) ; once myexe.exe started , it loading a dll file in which creating a TSQ and writing data to the TSQ . This dll returns the TSQ�s handle so that myexe.exe can handle it . After the dll returning the queue handle , myexe uses CmtInstallTSQCallback() to install a callback for the TSQ , in the callback , expecting that if the event of EVENT_TSQ_ITEMS_IN_QUEUE occurred , myexe can read out the data from the TSQ . The design target is this , but when running the application , I find that it can not trigger the installed callback for
read data from TSQ , I am confused , if the TSQ just could be used in the same process ?

David
0 Kudos
Message 1 of 2
(3,066 Views)
Hello

Im not sure if CreateProcess has anything to do with this, but I was successfully able to create a TSQ inside a dll, and use its handle from my calling program to fire callbacks for it. The Dll and the calling program are in the same process, Im not sure if you're trying to use the TSQ handle between processes, which is not suppose to work. You might want to double check to make sure that you are actaully meeting all of the conditions for the callback to fire correctly. And that you are processing events using ProcessSystemEvents() ( or RunUserInterface() if its a GUI app) so that the callback event gets processed.

I hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 2
(3,066 Views)