Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 980
  • Last Modified:

C++ DLL which raises events in VB or C#/C++

I'm looking for suggestions / tips on creating an oop c++ dll with a worker thread which will loop, do request info from a serial port and the trickiest part is raising an event from within a class object to a client application written in either VB or C#/C++. I've found examples of callbacks classes and understand how they work, an example of functors and I've got working examples of simple callbacks.

I'm looking for best practices with or without examples and suggestions on implementation to make this as flexible for clients as possible.
0
PmiDeveloper
Asked:
PmiDeveloper
2 Solutions
 
Luis PérezSoftware Architect in .NetCommented:
One simple way in which you can do it is using Atoms. I've written an article just on that. Please, read it and I hope that it will be useful to you.

Here's the link to the article:
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/A_233-Inter-communicate-applications-with-Atoms.html?sfQueryTermInfo=1+30+atom

Hope that helps.
0
 
alexey_gusevCommented:
depending on the nature of that 'port info' you can:

- pass callbacks to c++ dll and just call them whenever required
- send WM_COPY message from dll to the clients
- create COM c++ dll (ActiveX actually) with can fire events, and then handle these events in c#/vb.net
- use named events so clients can wait on their handles, but this doesn't give you any way to pass the data
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now