且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将MFC代码转换为Windows窗体应用程序

更新时间:2023-12-06 10:11:22

没有转换。你应该学习.NET并从头开始编写,只借用和翻译与UI无关的代码。这些概念有一些共同之处,但却截然不同。 .NET提供了更强大的UI开发功能,从本机平台中提取(仍然可以通过P / Invoke使用,除非绝对需要,否则不建议使用),而MFC在原始Windows API上相对较薄,因此它的级别要低得多,完全与具有非OOP接口的单一平台捆绑在一起。



-SA
There is no "conversion". You rather should learn .NET and write if from scratch, borrowing and translating only the code not related to UI. The concepts have something in common but very different. .NET provides much more powerful UI development capabilities abstracted from the native platforms (which can still be used via P/Invoke, not recommended unless it's absolutely needed), while MFC is relatively thin layer over raw Windows API, so it's much lower level, totally tied with a single platform with non-OOP interface.

—SA