Solved

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

Posted on 2010-08-22
2
967 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

636 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