LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to fire an event from LabVIEW DLL to be handled in VC++ program

Hi,

 

I want to pragrammatically fire an event in a VI in a LabVIEW-generated DLL, so that the event can be handled by a VC++ program that calls the LaVIEW-generated DLL.

I will appreciate it if someone solve my problem at the earliest.

 

Thanks and regards!

Javed

 

0 Kudos
Message 1 of 4
(2,327 Views)

 


@JavedAhmed wrote:

 

I want to pragrammatically fire an event in a VI in a LabVIEW-generated DLL, so that the event can be handled by a VC++ program that calls the LaVIEW-generated DLL.

I will appreciate it if someone solve my problem at the earliest.


 

Since this is a volunteer board for a large part your hope to solve your problem at the earliest is more or less irrelevant since nobody owes you anything here.

 

As to your problem it sounds a lot like a roundabout way of doing business. The most easy solution would be probably to let your C program register a Windows API event and give the handle to your LabVIEW VI as a pointer sized integer, then whenever your VI wants to fire that event it calls the according SetEvent() Windows API function passing it that handle. In your C program you have to wait on that event of course probably in a spawned thread.

Rolf Kalbermatter
My Blog
Message 2 of 4
(2,314 Views)

 

Thanks for your prompt response. Of course! You are right. No one owes me to reply to me at the earliest. It was just a request.

 

Back to the technical side, can you please send me an example how to register a Windows API event and pass its handle to a LabVIEW program which may fire the event which can be handled in a VC++ program?

Can we make an ActiveX of a VI and fire the event that can be handled in other ActiveX-supporting languages?

 

Regards,

Javed

0 Kudos
Message 3 of 4
(2,308 Views)

Look on MSDN for the APIs CreateEvent(), SetEvent(), CloseHandle() and related functions. I'm sorry but I don't have an example handy nor the time to create one.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 4
(2,302 Views)