Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

C# with C++

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ribaud@free.fr - 04 Mar 2005 15:03 GMT
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 !
adebaene@club-internet.fr - 04 Mar 2005 15:11 GMT
> 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
ribaud@free.fr - 04 Mar 2005 17:33 GMT
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
Arnaud Debaene - 04 Mar 2005 19:54 GMT
yoplaboum wrote:
> 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
Fredrik Wahlgren - 04 Mar 2005 17:16 GMT
> Hi,
>
[quoted text clipped - 6 lines]
>
> 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
ribaud@free.fr - 04 Mar 2005 17:56 GMT
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.
Magnus Krisell - 04 Mar 2005 17:56 GMT
I'm using Named Pipes for communication between my
apps, both managed (C#) and unmanaged (Visual C++).

Here's an article about it:

http://www.thecodeproject.com/csharp/DotNetNamedPipesPart1.asp

- Magnus

> Hi,
>
[quoted text clipped - 12 lines]
> Comprehensive, categorised, searchable collection of links to ASP &
> ASP.NET resources...
Fredrik Wahlgren - 04 Mar 2005 20:34 GMT
> I'm using Named Pipes for communication between my
> apps, both managed (C#) and unmanaged (Visual C++).
[quoted text clipped - 4 lines]
>
> - Magnus

Unfortunately, I'm not very familiar with named pipes.

/Fredrik
cyshao - 08 Mar 2005 08:29 GMT
you can relocated your std-in and std-out to a C# program.
Than, everything will be OK :-)

"yoplaboum" <ribaud@free.fr> ????????????
:e6jaQtMIFHA.2704@tk2msftngp13.phx.gbl...
> Hi,
[quoted text clipped - 11 lines]
> Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
> Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.