How can I use wpf with c++?
Someone got some harebrained idea to develop a c++ application with a GUI, so I thought of how WPF allows you to develop in C++ (which it then translates into C#, if memory serves me right). I found this documentation page: https://learn.microsoft.com/en-us/dotnet/desktop/wpf/advanced/wpf-and-win32-interoperation?view=netframeworkdesktop-4.8
Which presents several ways to connect a C++ application to WPF in the section called "WPF Interoperation Projects", I would like a recommendation on which is the simplest, considering that this will be a simple app and I don't have experience coding C++ for a WPF application. And also some help on how to implement it (later, not now).
WPF and Win32 interop
Learn how to interoperate Windows Presentation Foundation's environment for creating applications and Win32 code.
4 Replies
U can look at this video:
https://www.youtube.com/watch?v=5U7XQUi538c&ab_channel=CodingExpress
Coding Express
YouTube
Hosting C++ Win32 window inside a C# WPF Window - Step by step + So...
Hello friends, in this video I will create a Win32 window in c++ and host it in a C# WPF window. I will use 2 projects in the solution: One for the C# WPF application which will be the entry point, and the second is a C++ dynamic library that we will use from the Main C# WPF application to get the generated Win32 handle.
I hope you will learn s...
WPF is a C# framework, there is no translation from C++ to C# that i'm aware of
that article is telling you you can only use it in a mixed project (C++/CLI)
is there a reason you want this particular combination? there are other GUI frameworks for C++
I've begun exploring this option, Qt specifically
winui 3 supports c++
if you want xaml