Which toolkit should I use to make an easily editable and modern looking GUI for existing c++ code?
I am starting a new small project where the graphic interface and a bit of juggling data too and fro is missing, but the complex and time-critial parts of the code exist and are written in c/c++. Previously I've used the win32 api, MFC to do the graphics, but I want something a bit more modern looking and newer and something that is a bit simpler to maintain and update. I should probably mention 开发者_Go百科that I also want to try out and learn something new...
A few years ago I tried integrating c++ components to c# using pinvoke. It turned out quite messy. But that was a long time ago...
Any tips? What should I use?
Prerequisites: Windows (XP or 7) and VS 2005, 2008 or 2010. Eclipse should also work fine.
You could try QT or wxWidgets that are both good C++ GUI toolkits. If you don't have much entry point in the c++ code yuo could wrap them in few C# classes and use WPF or windows form (.NET 4 or 2). Anyway this requires to "mix managed and unmanaged code".
Haven't tried it myself in a long time, but from what I hear .NET integration with managed/native is pretty good these days:
- requires no extra tinkering or dependencies; when the project is in Visual Studio, you're ready to roll,
- pretty straight-forward GUI coding,
- simple to maintain,
- any language of your pick for the GUI: C#, F#, J#, managed C++ and more (comes in handy when you want to try something new).
I would recommend integration between C# and C++ using C++/CLI aka Managed C++. With the main project being C++/CLI using C# classes for visually designed GUI. No pinvoke should be necessary. All code (GUI and library part) could even be contained in a single executable (but dependent on the presence of .Net).
If the budget was not an obstacle (around 150$ in this case) I would also mention C++Builder - visual GUI design and native executable ( no .Net dependency)
You write the GUI using QT, and link in your existing C++ code.
精彩评论