Solved

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

Posted on 2010-08-22
2
912 Views
Last Modified: 2012-05-10
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
Comment
Question by:PmiDeveloper
2 Comments
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 125 total points
ID: 33508404
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
 
LVL 24

Assisted Solution

by:alexey_gusev
alexey_gusev earned 125 total points
ID: 33539646
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VB.NET Server side Javascript 8 51
Need help with a query. 10 43
Getfiles in vb.net 28 22
Saveas need to save a copy 16 11
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now