G
Guest
Hi all,
I guess this question has been asked many times in the past, but as a .NET
newbie ....
I have an MFC application from which I want to display some WinForms. The
desired sequence is something like:
- User presses a button
- Winform opens up like any MFC modal dialog.
- User enters some data, clicks the Winform's close button and control
returns to the MFC application.
Trying to achieve this I created a C# class library project, added a form to
it with a public SayHello() method. marked it as registered for Interop (in
project settings). Then created a simple project and imported the generated
TLB.
I encountered the first problem: the generated C++ tlh files contains only
CoClass and interface declaration. My SayHello() method is not exposed in
the com interface. Trying to mark it as ComVisible(true) didn't work.
Second (major) problem: What's the replacement of Application.Run() in MFC?
What's the right way to invoke the form to open up?
Thanks,
Omer
I guess this question has been asked many times in the past, but as a .NET
newbie ....
I have an MFC application from which I want to display some WinForms. The
desired sequence is something like:
- User presses a button
- Winform opens up like any MFC modal dialog.
- User enters some data, clicks the Winform's close button and control
returns to the MFC application.
Trying to achieve this I created a C# class library project, added a form to
it with a public SayHello() method. marked it as registered for Interop (in
project settings). Then created a simple project and imported the generated
TLB.
I encountered the first problem: the generated C++ tlh files contains only
CoClass and interface declaration. My SayHello() method is not exposed in
the com interface. Trying to mark it as ComVisible(true) didn't work.
Second (major) problem: What's the replacement of Application.Run() in MFC?
What's the right way to invoke the form to open up?
Thanks,
Omer