C# 如何在 MFC 应用程序中托管 WPF 表单

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11423/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-07-31 17:38:55  来源:igfitidea点击:

How to host a WPF form in a MFC application

提问by mkinkade

I'm looking for any resources on hosting a WPF form within an existing MFC application. Can anyone point me in the right direction on how to do this?

我正在寻找有关在现有 MFC 应用程序中托管 WPF 表单的任何资源。任何人都可以指出我如何做到这一点的正确方向吗?

采纳答案by TheSmurf

From what I understand (haven't tried myself), it's almost as simple as just giving the WPF control the parent's handle. Here's a Walkthrough: Hosting WPF Content in Win32.

据我了解(我自己没有尝试过),这几乎就像将 WPF 控制权赋予父级句柄一样简单。这是一个演练:在 Win32 中托管 WPF 内容