Click here to Skip to main content
15,893,668 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to embed a C++ MFC dialog into a C# form?
Posted
Comments
Sergey Alexandrovich Kryukov 7-Jan-16 3:32am    
In principle, this is quite possible, but it's hard to invent something which would make so little sense. Better don't do it.
—SA
Maciej Los 7-Jan-16 3:39am    
Sergey, can you elaborate why it's better to not doing it. Please, see my comment to the question too.
Sergey Alexandrovich Kryukov 7-Jan-16 3:46am    
Because one the power of .NET UI makes MFC UI ridiculous in comparison, plus the effort of "integration". It's easier to write 10 .NET UI with much better quality. I would understand if native application was required, but if the application is already .NET. Of course, using C++ code may make sense, but not MFC...
—SA
Maciej Los 7-Jan-16 3:58am    
Thank you for clarification.
Maciej Los 7-Jan-16 3:38am    
I know that hosting winform in mfc app is possible, but in other direction...

1 solution

The obvious and natural solution your problem it is better to embed the dialog in the C# form. Open the form in the resource editor and build it in C#.

This has the big advantage that all data is already in C#.

Remark: other solution are REALLY more sophisticated, error prown and problematic. (dll, Active-X,exe)
 
Share this answer
 
Comments
CPallini 7-Jan-16 3:58am    
My 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900