I am trying to Host a WPF application inside a C++/MFC window.
I found this answer, but because of my lack in C++ knowledge I fail in following it: How do I host WPF content in MFC Applications?
I don't have the reputation to comment there so I am asking here if someone has a very (very) basic example of this.
I need to make a basic wpf window with a button that generically adds TextBlocks to a stackpanel
namespace wpfExample
{
public partial class MainWindow : Window
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
TextBlock tBlock = new TextBlock();
tBlock.Text = "Example";
StPanel.Children.Add(tBlock);
}
}
where StPanel is the Name of the StackPanel
Now on the C++ side I need a CPropertyPage(CDialog or CWnd) Type, with the WPF Page.
https://i.stack.imgur.com/589U6.png This is from an example I found which shows how it should look like(only in the right top corner should be the wpf window) The Example: https://msdn.microsoft.com/de-de/library/ms771352%28v=vs.85%29.aspx