Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WinForms or WPF or Qt for Windows GUI with C/C++ as backend

Tags:

c++

c#

winforms

wpf

qt

I am to develop an application on windows. I have never done that before ;-)

I need to do some heavy audio calculation, which has to be written in C/C++. This part will be a room correction algorithm which currently takes about 10 seconds per channel to run in Matlab. It has to be written in C/C++, since it might be ported to a DSP later on, which has to be programmed in C/C++.

Additionally, I need a GUI to review calculations, visualize results and modify calculation parameters. The tough part of this GUI will be lots of plotting of spectra, spectrograms, audio waveforms and the like.

Now, I hear that WPF is all the rage in Windows GUIs, but it seems to be limited to C#. Is there a simple way to integrate my C/C++ code with some C# GUI code? Or should I rather take WinForms and just write the whole thing in C++? Or would Qt work just as well and provide some cross-platform capabilities "for free"?

I have some experience with C/C++, Matlab and VST-development, but I never wrote a real application and honestly, I don't even know where to start.

Thank you in advance!

like image 955
bastibe Avatar asked Feb 03 '23 09:02

bastibe


2 Answers

I think the biggest drawback to using WPF or WinForms is that you will have to program in two programming languages, which is a big logistics overhead.

I've seen this type of argument before: use C or C++ for low level, something else for high level. In this case Qt/C++ is as high level as WPF/WinForms, with the benefit of very easy integration of UI to your other C++ code.

For spectrograms and other graphs check out Qwt.

P.S: WPF is not all the rage on Windows, in fact the market is quite fragmented and WPF is one of the lesser used GUI toolkits. Most of the code out there uses MFC, WTL, Delphi, Win32, etc.

like image 137
rpg Avatar answered Feb 06 '23 11:02

rpg


I have no experience on QT, but I can say that WPF is good but its not that good for high CPU intensive applications, plus you will not be able to directly integrate your c/c++ easily with WPF.

There will be huge learning curve and you will have to write COM Interfaces to communicate with C#/WPF and your native code. or Visual C++ .Net CLI, which is quite difficult and less tutorials are available.

But problem is you will not get any good support because lots of people only use C#, database apps only with WPF/WinForms. The best way to do is, you can write COM DLLs to integrate with WPF, but that will be difficult.

Instead there are various tools available now in MFC, and lot of other commercial libraries are available as well to write good UI in C++ MFC, where integration will be quite easier as you are familier with C++.

Or else Qt, if you already know it.

Libraries:

Prof-UIS

BCGSoft

There may be many, you can search for "MFC UI Elements", Library etc. I have used Prof-UIS way back in 2003-4 they are good.

like image 28
Akash Kava Avatar answered Feb 06 '23 09:02

Akash Kava