Calling c# code from c++

Calling c# code from c++

Post by Yoav » Thu, 28 Sep 2006 21:26:17


Hi,
I have an C++ MFC application and a c# DLL (which contains a Form class).
I want to invoke the c# dialog from the C++ application.

How do I do it ?

thanks,
Yoav.
 
 
 

Calling c# code from c++

Post by .NET/ C# » Thu, 28 Sep 2006 23:33:36

Hi,

You have to make the DLL visible to COM ( a check mark in the project
properties )

Then ou can use it as any other COM component


--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

 
 
 

Calling c# code from c++

Post by Carl Danie » Fri, 29 Sep 2006 00:54:42


If you are compiling your MFC application with VC++ 2005, then you can
easily add a managed module to your MFC application to call the C# dialog.
There's also a CWinFormsView class that lets you host a WinForms form inside
an MFC View object, so it can interact with the rest of your UI just like
any view.

If you're using VC 7 or 7.1, you can still add a managed module to your MFC
application to provide the bridge to the C# form.

If you're using VC6 or earlier, then COM interop is about your only option.

-cd
 
 
 

Calling c# code from c++

Post by Yoav » Fri, 29 Sep 2006 19:37:43

Hi Carl,
Does your first solusion ("add a managed module to your MFC...") relevant
for unmanaged application (my MFC application is unmanaged).
If so, how do I add a managed module to my MFC application ?

Yoav.

"Carl Daniel [VC++ MVP]" < XXXX@XXXXX.COM >