C # controls in an MFC application

I am responsible for the user interface of an application written entirely in Visual C ++, using MFC and some third part controls. I would like to use C # (WinForms or even better WPF) to improve the look and feel of the application.

I would like some tips on how to do this. Links, articles, examples ...

Currently, the user interface is isolated in one project, and I do not want to compile the entire module using the CLR. So how do I manage this from an architectural point of view?

I already browsed the Internet for the topic and read the MSDN information. I would like more information ... is it convenient? pros and cons? Have you successfully used this approach in a "large" application? I don't want to compile the whole ui project using the CLR ... can I just use all the .NET code in an isolated project and name it from the ui project? What's the best way to do this?

Thanks in advance.

+3
source share
3 answers

A good starting point is Win32 and WPF interop on MSDN.

+1
source

I found this article in the encoder, gave a good introduction to the topic of mixing mfc / winforms code.

+1
source

When you ran into the same problem, I created an ActiveX control in C # and used it in my MFC application. People from MS got support for creating ActiveX controls with .NET, but this is still possible with the simple Jane COM class, which has custom [ComRegisterFunction()]and [ComUnregisterFunction].

Although MS would like to tell us that the / clr flag will solve our problems, it will noticeably slow down my large MFC application.

+1
source

Source: https://habr.com/ru/post/1698137/


All Articles