C# with C++

  • Thread starter Thread starter ribaud
  • Start date Start date
R

ribaud

Hi,


I have a win32 mfc c++ non managed app ( created with vs6)
which is too critical to transform into managed c++.
I need to create a c# application which can run this application, and
communicate with, like send string (for ex, received from msn), etc ...

Is it possible to create a such app, keeping the performance of my initial app ?

thx !

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
Hi,


I have a win32 mfc c++ non managed app ( created with vs6)
which is too critical to transform into managed c++.
I need to create a c# application which can run this application, and
communicate with, like send string (for ex, received from msn), etc
....

- You can launch another process from a managed app. See
System.Diagnostics.Process.Start.
- Concerning "communication" with the other app, it all depends on how
this other app is written and it should communicate with the outside
world.
Is it possible to create a such app, keeping the performance of my
initial app ?
Most of the time, performance is not a problem when migrating from
unmanaged to managed.

Arnaud
MVP - VC
 
yoplaboum said:
Hi,


I have a win32 mfc c++ non managed app ( created with vs6)
which is too critical to transform into managed c++.
I need to create a c# application which can run this application, and
communicate with, like send string (for ex, received from msn), etc ...

Is it possible to create a such app, keeping the performance of my initial app ?

thx !

What does this non managed app do? I suppose it doesn't support COM.
Communication can be tricky if it's supposed to be run by a real user and
gas a GUI.

/Fredrik
 
oh ok thanks :)

so ... do you have some advices and examples to give about communications with a win32 app process and the mainapp c# app ?

michaël

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
it's a huge app of many projects which offers services to create and manipulate various elements.
mfc are used to see and set the parameters of the created objects.

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
yoplaboum said:
oh ok thanks :)

so ... do you have some advices and examples to give about
communications with a win32 app process and the mainapp c# app ?

How does the MFC app communicates *now*? Does it expose COM objects? Does it
listen on a socket? Uses it some other kind of IPC (named pipe, memory
mapped file, ...)?
If the MFC app is ont designed at all to be programmtically pioted, your
only bet (short of adding the needed functionnalities to the MFC app), is to
send window messages to it's window(s) in order to emulate the user
interaction. This is ugly and error prone but may work. Use P/Invoke to use
the PostMessage/SendMessage Win32 APIs.

Arnaud
MVP - VC
 
you can relocated your std-in and std-out to a C# program.
Than, everything will be OK :-)


yoplaboum said:
Hi,


I have a win32 mfc c++ non managed app ( created with vs6)
which is too critical to transform into managed c++.
I need to create a c# application which can run this application, and
communicate with, like send string (for ex, received from msn), etc ...

Is it possible to create a such app, keeping the performance of my initial app ?

thx !

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...
 
Back
Top