is it possible to receive event raised from C++ dll in VB .NET?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am forced to create a dll driver in eVC++, but the application in VB .NET.
The application is expected to receive message from the dll, instead of
doing a polling, I am wondering if it is possible to create an event in
the dll and set the event whenever there is message available to the
VB application. Can anyone tell me if this is feasible? And how the event
being linked between the DLL and the VB application?

Thanks.
Carl
 
Yes. use CreateEvent/SetEvent in the C++ code, then P/Invoke CreateEvent
and WaitForSingleObject in your managed code. Go one further an put the
P/Invokes in a worker thread which then raises a managed event when it
receives the event and to an application it will look like the C++ DLL is
generating managed events.

-Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top