473,236 Members | 1,550 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,236 software developers and data experts.

C#.exe "talks" to C++.exe

Hello All,
Thanks for your help first, I wonder is there any link to sample or
documentation that explain how to make .exe in C++ communicate to .exe in C#?
I know there is some way like Share Memory, COM but I really need a
place that I could get jump start
Thanks
Have a wonderful day

Anthony
Dec 11 '05 #1
2 2723
Anthony wrote:
Hello All,
Thanks for your help first, I wonder is there any link to sample or
documentation that explain how to make .exe in C++ communicate to
.exe in C#? I know there is some way like Share Memory, COM but I
really need a
place that I could get jump start


By C++ exe I assume you mean unmanaged code. If the unmanaged process is
a COM local server then it's easy, you just use tlbimp to create the
import assembly and use it in the .NET application. Of course if the
native process is not a COM server and you are not a COM developer it
might not be straightforward for you to add that functionality to your
unmanaged process.

Shared memory is another option, but there is no .NET API to do that. If
you want a clue then I recommend that you use Reflector and take a look
at how .NET handles performance monitor counters (for example, take a
look at the private type System.Diagnostics.SharedPerformanceCounter).
Note that if you have memory shared between processes then you need to
control access to it using some locking mehanism accessible to both
processes, like a couple of named events, or a named mutex.

The simplest solution is to use sockets. The native process can be a
server and the .NET process could be a socket client, and hence it would
be able to 'talk' to the native process. The internet is awash with
examples of writing socket clients and servers in .NET and with Winsock.

Richard
--
http://www.grimes.demon.co.uk/workshops/fusionWS.htm
http://www.grimes.demon.co.uk/workshops/securityWS.htm
Dec 11 '05 #2
Thanks Richard Grimes,
It's really help me for a jump start, I appeciated that
Have a great day
Anthony

"Anthony" wrote:
Hello All,
Thanks for your help first, I wonder is there any link to sample or
documentation that explain how to make .exe in C++ communicate to .exe in C#?
I know there is some way like Share Memory, COM but I really need a
place that I could get jump start
Thanks
Have a wonderful day

Anthony

Dec 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: phong.lee | last post by:
I was wondering why when you create a macro and you choose quit, it close out the whole app? i'm running a macro that does alot of appends and updates and at the end i want to be able to save all...
19
by: Jasper Dozer | last post by:
Is this a healthy way to get a pointer to point ? char *p = "longenough"; regards, jasper
388
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's...
9
by: rnn98 | last post by:
hi, my multithread application, running under solaris box, is crashing eventually. I tried to spot and substitute functions not "thread safe", but I guess my search wasn't good enough. I have put...
72
by: Paminu | last post by:
In math this expression: (a < b) && (b < c) would be described as: a < b < c But why is it that in C these two expressions evaluate to something different for the same values of a, b and...
4
by: Patrick | last post by:
I'm writing a winforms database application in C#. I've come across a lot of stuff lately about "N-Tier" architecture. Can anyone give me a simple explanation of N-Tier? The descriptions that...
0
by: Samuele Pedroni | last post by:
Registration for Europython (3-5 July) at CERN in Geneva is now open, if you feel submitting a talk proposal there's still time until the 31th of May. If you want to talk about a library you...
94
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock...
11
by: Robert Latest | last post by:
Hello, From a list of strings I want to delete all empty ones. This works: while '' in keywords: keywords.remove('') However, to a long-term C programmer this looks like an awkward way of...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.