3

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

I would like some advices about how to do it. Links, articles, examples...

Right now the user interface is isolated in a single project and I don't want to compile the whole module with CLR. So how do I have to manage that from the architectural point of view?

I have already looked at the Internet for the subject and read MSDN information. I would like more detailed information...is it convinient? pros/cons? have you used this approach successfully in a "big" application? I don't want to compile the whole ui project with CLR...can I just have all the .NET code in a isolated project and call it from the ui project? what's the best way to do it?

Thanks in advance.

4

3 回答 3

1

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

于 2008-10-10T11:03:12.340 回答
1

I found this codeproject article gave a good introduction to the subject of mixing mfc / winforms code.

于 2008-10-10T11:06:49.320 回答
1

当遇到同样的问题时,我用 C# 制作了一个 ActiveX 控件并在我的 MFC 应用程序中使用它。MS 的人员支持使用 .NET 构建 ActiveX 控件,但仍然可以使用具有自定义[ComRegisterFunction()][ComUnregisterFunction].

尽管 MS 想告诉我们 /clr 标志将解决我们的问题,但它明显减慢了我的大型 MFC 应用程序的速度。

于 2008-10-10T13:39:57.720 回答