Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF with C++, is it possible?

I have my main program in C++, but now I need to build a beautiful application and I know that WPF is easy and makes for beautiful apps. Can WPF work with C++ or C# and C++? (If yes, how?) Is WPF the best thing for me?

like image 353
bdelmas Avatar asked Jun 21 '11 15:06

bdelmas


People also ask

Can I use C++ in WPF?

Using C++ as my backend application and WPF/Winform for GUI and frontend because it's safe/fast in backend and pretty/easy-to-use in frontend. In this solution, you can use WPF/Winforms and QT and whatever else you want together.

Is WPF still relevant 2022?

“WPF would be dead in 2022 because Microsoft doesn't need to be promoting non-mobile and non-cloud technology. But WPF might be alive in that sense if it's the best solution for fulfilling specific customer needs today. Therefore, having a hefty desktop application needs to run on Windows 7 PCs with IE 8.

Is WPF only C#?

WPF uses XAML as its front end language and C# as its code behind language. The current version of WPF is 4.5. WPF, stands for Windows Presentation Foundation is a development framework and a sub-system of .

Does WPF have a future?

This move clearly explains that Microsoft sees a future in WPF and considers it as a UI framework for the . NET platform. Microsoft has really invested a lot in WPF by making it open source and making it work on . NET Core.


2 Answers

You can use WPF in a managed C++ project, but you're better off keeping your C++ in a separate assembly and referencing it from a C# or VB WPF project.

like image 83
Tim Rogers Avatar answered Oct 01 '22 18:10

Tim Rogers


Yes, you can develop a GUI using WPF framework in Managed C+ or C++/CLI. But they're not Standard C++, hence not cross-platform.

If you just want a GUI for your application written in C++, then you may try Qt as well. The advantage in Qt is that its completely in C++. Not Microsoft Managed C++. The second advantage is that its cross-platform toolkit. That means, you can run your app in Windows, Linux, Mac, and on other machines as well.

Have a look at its documentation

  • Qt Reference Documentation

It has lots of tools for fast development such as Qt Creator, Qt Designer and others. You can see all of them by browsing the above link.

like image 37
Nawaz Avatar answered Oct 01 '22 19:10

Nawaz