interprocess communication c# c++

C

cartez

hello
I have and application that is performing live image processing
written in native c++
The application is working well but the GUI is not fancy (good old
mfc)
Is there a way to have an application in C# to manage the gui ?
This C# application should exchange some common data with the c++
application and more importantly should be able to display the images
aquired and processed by the c++ application.
Thanks
 
R

Rob

Hi,
Yes ofcourse thats possible.
The data interfaces on the c# side will basically stay the same though.
Not sure if such a scheme will make life easier for you.
Initial implementation of the interface is extra anyway.

if "fancy" is your requirement, you might achieve this in c++ too.

Kind regards,
Rob
www.robtso.nl
 
I

Ignacio Machin ( .NET/ C# MVP )

hello
I have and application that is performing live image processing
written in native c++
The application is working well but the GUI is not fancy (good old
mfc)
Is there a way to have an application in C# to manage the gui ?
This C# application should exchange some common data with the c++
application and more importantly should be able to display the images
aquired and processed by the c++ application.
Thanks

Hi,

It depends of the legacy application. IF it provides an API or export
the functionality using COM (the best solution) then you can do it,
otherwise I do not see how you could do it.
 
I

Ignacio Machin ( .NET/ C# MVP )

Hi,
Yes ofcourse thats possible.

It's not that easy, it depends of how the app. is designed. You can
easily have business code (image processing in this case) inside the
UI classes.

Of course that having the source code ( BTW, the OP does not specify
this part) will help.

I do not know how easy it would be ported to managed code, but it
could be a possible compromised solution
 
B

Ben Voigt [C++ MVP]

message
Hi,

It depends of the legacy application. IF it provides an API or export
the functionality using COM (the best solution) then you can do it,
otherwise I do not see how you could do it.

Recompiling with /clr so that the native code becomes a .NET assembly is a
good option. You need to do a little work writing new C#-visible "ref
class" types to expose the main functions, but this is much easier and
faster than trying to write p/invoke calls, and works properly with
non-trivial C++ classes (p/invoke can only call global functions).
 
A

Arne Vajhøj

cartez said:
I have and application that is performing live image processing
written in native c++
The application is working well but the GUI is not fancy (good old
mfc)
Is there a way to have an application in C# to manage the gui ?
This C# application should exchange some common data with the c++
application and more importantly should be able to display the images
aquired and processed by the c++ application.

There are several ways of calling C++ code from C#:
COM and plain DllImport.

Your subject lines says interprocess which indicates that
you are considering running a C# app and a C++ app. If that
is the case, then there are several additional options. Two
of them are good old TCP/IP and named pipes.

Arne
 
C

cartez

Ok thanks for all answers
I have made some more research in the mean time
I have the source code so I will give a try to port to managed c++
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top