473,326 Members | 2,175 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,326 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 2727
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
1
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.