By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,896 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,896 IT Pros & Developers. It's quick & easy.

Calling c# code from c++

P: n/a
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.
Sep 27 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

"Yoavo" <yo**@cimatron.co.ilwrote in message
news:uv****************@TK2MSFTNGP05.phx.gbl...
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.

Sep 27 '06 #2

P: n/a
Yoavo wrote:
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 ?
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
Sep 27 '06 #3

P: n/a
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]" <cp*****************************@mvps.org.nospam >
wrote in message news:%2****************@TK2MSFTNGP02.phx.gbl...
Yoavo wrote:
>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 ?

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


Sep 28 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.