Computing.Net > Forums > Programming > Passing data from C++ to C#

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Passing data from C++ to C#

Reply to Message Icon

Name: Nil_IQ
Date: November 23, 2006 at 05:24:14 Pacific
OS: Win XP
CPU/Ram: Enough
Product: Dell
Comment:

Hi. I'd like to start by saying my C++ skills are intermediate at best, so bear with me if i'm asking stupid questions, or if I don't understand your answers fully.

What i'm trying to do is take data gathered by a C++ console project, and pass it to a C# windows application. The idea is that the data from the console program will cause some buttons to flash on and off and make a progress bar go up and down depending on what data the console program sends.

The console application is based off of this: http://www.music.mcgill.ca/~gary/rt...

with a few minor modifications of my own.

The most obvious solution here would be to write the console data to a file, then have the C# program read and use it. Unfortunately I don't think that this is going to work, as the data transfer has to be real-time, or at least as close to real time as possible (a delay of several seconds might be ok). Also I'm not sure if two programs can have a file open at the same time.

I'm open to any solution, so long as the data gets from point A to point B in under 3 seconds.

Thanks for your time,

Nil



Sponsored Link
Ads by Google

Response Number 1
Name: Guy
Date: November 25, 2006 at 07:51:03 Pacific
Reply:

I would seriously consider a socket connection between the two systems.

A little bit of a pain to write, but very fast.

Guy


0

Response Number 2
Name: SN
Date: November 27, 2006 at 16:24:57 Pacific
Reply:

Does the C# application start the C++ application's process (using something like Process.Start())? If so, I would just redirect the output stream for the C++ process and read it in C#...Should be nearly instantaneous. There's various ways to do it, I have some code that should be a pretty good starting point. If you need it, let me know and I'll e-mail it to you. It's too long to post here.

Good luck,
-SN


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Passing data from C++ to C#

Passing Strings from Fortran to C www.computing.net/answers/programming/passing-strings-from-fortran-to-c/6992.html

How to send the data from Access to Exce www.computing.net/answers/programming/how-to-send-the-data-from-access-to-exce/714.html

Pass data from tab Controls vb.net? www.computing.net/answers/programming/pass-data-from-tab-controls-vbnet/14360.html