How to go about creating a windows application - c++

I've been looking at a lot of different options for creating a GUI windows application. Win32, Windows forms, MFC to name a few. I know my C++ well, I just need some advice on where I should start learning some GUI for windows. Thanks!

Qt has helpful tutorials. Easy to learn. Open source. Many resources on the web!

MFC is quite a dated technology now; The kinds of books/tutorials available for it are similarly aging. QT is becoming far more widely used and is likely a much better starting point from a learning perspective.
There are of course plenty of other alternatives beyond C++; C# and .NET are good choices if you are specifically interested in development on Windows. C++ programmers tend to find their feet in C# quite quickly, although any new language/environment does of course have an extra learning curve

I would look into Qt, OpenGL and SDL (Simple Directmedia Layer).
Qt provides an easy way to build GUIs, I would (loosely) compare it to Java's Swing.
OpenGL and SDL are more about plain graphics, both being used in various games and applications.

I use MFC commercially and I'd have to say for strictly GUI/Windows apps, you might want to look at C# (either Winforms and/or WPF). MFC is getting pretty dated. You can get a lot more done in the same amount of time with C#. Sure it might run a tiny bit slower, but for UI apps, I think programmer time is much more important metric than execution time.
If you want to use C++ for UI, maybe have a look at Qt. It is continually updated/enhanced and is not limited to a single platform like MFC is.
Good luck!

It is as helpful to develop a windows based applications! their are many open sources and Ides to develop windows applications.
One of them are Visual Studios, it is an IDE ie..(Integrated Development Environment) developed by Microsoft for both windows and web based applications development.As it has an advantage that an individual should be proficient in any programming language that he/she knows about.This IDE is integrated with the .net framework which have the capability to manage the code and compile with the help of Microsoft Intermediate Language (MSIL)and CLR common language at Run-time.The type checking is handled by Common type Specification for all Programming languages.JIT compiler is a compiler to execute to semi finished code and turns to code in to bytes.The main languages are handled by these IDE are C++,VC++,C#,Visual Basic,F#,J#..etc

Related

Building simple GUI without resorting QT or .NET using native C++?

Are there any platforms to build GUI platform without resorting to QT or .NET using native C++ ?
QT is cool, but take a lot of time to learn, in addition it has a lot of things I don't really need and really dislike QT IDE, compared to Visual Studio (I know you can use QT within Visual Studio)
.NET suffers same problem (I am actually learning C# and WPF right now, though it looks like WPF is somewhat easier to program and you can call native C++ code from WPF)
I am looking for something that is: relatively easy learn, does not have to have advanced features, works with C++11, support C++11 multi-threading, works with Visual Studio. Planning to build some applications for Numerical analysis.
There are lots of alternatives with varying levels of support in VS.
MFC has quite a bit of direct support in Visual Studio in the form of code generators, Wizards, etc. Unfortunately, the basic design is very old and hasn't aged very gracefully at all. Quite a few programmers not only would but do cite it as a prime example of a library that's better avoided if humanly possible.
WTL is Microsoft's other class library for producing Windows applications. It's a much newer design than MFC and generally considered much cleaner and nicer. As implied by the name, it's heavily template based, which helps it produce applications that are generally considerably smaller and faster than MFC ever attempted. For better or worse, Microsoft placed it under a fairly permissive open-source license some time ago, and updates since then have been quite minimal. Despite both being from Microsoft, Visual Studio has never done much to support WTL development.
wxWidgets started as more or less a clone of Microsoft's MFC, but has continued active development while MFC has mostly stagnated. It now has quite a few features (e.g., XML-based UI design, layout managers) far beyond anything MFC ever even considered including.
Ultimate++ is a fairly unusual toolkit that has mapped its own route (so to speak) that's quite a bit different from most others. They have their own IDE (TheIDE). Code can be quite simple and short, but is enough different from most typical C++ that many people find it difficult to grasp at first (and some experienced C++ programmers don't particularly like how some thing work).
GTK+/gtkmm is less of a Windows framework than a Linux framework that's portable enough to also work under Windows. It's probably not your best choice if you're developing exclusively (or even primarily) for Windows. These are also much more purely GUI frameworks than most others (i.e., they don't include things like collections, networking, cryptography, etc., that many others do include).
FLTK is another cross-platform toolkit. Its fairly small and fast, but somewhat like GTK+, it seems (at least to me) less like a Windows toolkit, than a Linux toolkit that happens to be portable enough that it can also work on Windows (but the results don't look or feel much like most Windows applications).
Juce was originally used to develop some music software (Traktion) so it includes a lot of music-oriented functionality. It also have some fairly unusual widgets that most others don't include (especially widgets that imitate controls you'd see on all sorts of audio equipment). Nonetheless, it has a solid core of basic GUI functionality, as well as the usual "extras" like network, crypto, XML and JSON, etc. Although I haven't tried to do anything like a full review of the code, it appears to be rather better written than most.
That's not a complete list by any means, but I think it hits most of the more popular/widely used GUI toolkits (other than Qt, of course).
Some time ago I asked myself exactly that same question.
I wrote my program using C++/CLI, which was not bad (my C++ code was very well isolated from the GUI/CLI part), but sharing the executable with others was a problem: it was the typical - it runs in my PC(...only). So, I needed a light alternative to the user unfriendly command line programs in scientific calculations, which I could easily share.
I am now happy to use Nana. Please join the group of users and / or developers of Nana and... have fun!
GUI with Nana C++ Library
Nana C++ Library takes aim at easy-to-use and portable library. It
provides a GUI framework and threads for easy programming with modern
C++ methods, such as traits, metaprogramming and other template
technologies.
Since you plan to develop exclusively for Windows, I think you should stay with MS provided GUI toolkits. While third party toolkits may provide the cross platform advantage you already said don't need, they add complication and dependencies.
Complication by for example when a new Visual Studio is released, then you have to wait for the toolkit to get that new VS supported, and dependencies, which means more dlls to be installed on the target system.
Plus some toolkits do not use the native look of the operating system, like many java programs for example.

What is the best way to get started in GUI C++ programming?

So, I learned C++ (fundamentals) and I want to write software, however I have stumbled upon a problem where I don't know where to get started. It seems like learning C++ was the easiest part by far when it comes to understanding the libraries for the GUI construction the concept I yet don't fully comprehend. I searched a lot and couldn't even decide been a new guy on MFC, Win32 or Qt.
Qt C++ GUI seems like a fun and easy to use software with the definitions of classes available right there quickly.
With Visual's MFC I am seeing a lot of code upfront on the pre made project file and a lot of description of classes, however getting definitions is a bit slower as I have to go to the internet.
Win32 is apparently written in C and is not updated much?
A lot of people recommend Java and C# as well, but I am not interested in learning a new language when I don't have C++ set in stone and practiced with enough yet.
Not sure how to go about this.
Go with Qt if you envision porting your program to platforms other than Windows and/or your actual UI needs are relatively straightforward. But Qt, being "fun," abstracts you away from the Windows API, so if you find yourself needing to access features of that API not offered by Qt, then you'll be up the creek. So go with MFC if you're staying on Windows and you're building an application whose complexity or Windows-specific features may require more direct access to the Windows API. MFC provides a thin abstraction layer over that API; its concepts map more or less one-to-one with the API's concepts.
What kind of GUI do you want? Any framework should be able to do any kind of GUI, but some are optimized for certain work:
MFC is optimized for making applications that edit documents, like MS Office programs Word, Excel, Powerpoint.
wxWidgets and Qt (and .NET WinForms and WPF) are optimized for any sort of app that primarily uses widgets (textboxes, buttons, menus).
SDL is optimized if you want to draw stuff, like graphs or vector artwork.
I wouldn't recommend that you use MFC since it isn't a good fit for most applications, and also doesn't use modern C++ design, it's loaded with workarounds needed for stuff that was broken in early versions of Visual C++ and now can't shake those workarounds because of backward compatibility.
The Win32 API is actually really useful to know regardless of what kind of application you want to make, because it defines the rules for how the UI interfaces to the rest of the system. Yes, it's written in C, but this is to make it usable from any programming language, not because it's an obsolete design. Win32 API is highly object-oriented and uses polymorphism extensively.
Few things you need to be aware of:
If one day you want to sell a program written using Qt you might need to purchase a license.
If you feel like GUI applications/ GUI programming is what you want to do in general, for windows platform you better learn WinForms or even better WPF (with C# of course).
If you just want to quickly put up simple GUIs for your C++ programs for learning purposes, and you don't care much about learning the frameworks and licensing issues, just go with Qt or wxWidgets.
MFC is outdated. If sticking with C++ on Windows, I recommend you to lean C++ CLI.
However I suggest you to learn c# directly since c# is the mainstream language in .Net world.
For GUI, the windows world is now dominated by WPF.

How does C++ builder stack up against other RAD IDEs?

It has been a few years since I did any development for PCs (I usually do embedded software).
At that time I was highly proficient with (Borland, now CodeGear) C++ Builder. Time has moved on, C++ Builder has become extremely expensive and there are alternatives (MSVC studio, NetBeans, QtCreator, maybe even Eclipse with the right plugins). Others?
Three things concern me (in no particular order), ease of use, additional GUI components and cross-platformness.
Ease of use - I want an IDE which helps, not hinders me. Good debugger, refactoring, jump to variable declaration, usage, that sort of thing ..
GUI components - when using C++ Builder I was impressed by how easy it was to develop additional VCL components and how many were available, often for free. Thus if I wanted a standard string grid where the cells also could contain pictures, checkboxes, etc, I could probably find one, or roll my own.
I am not sure what the current state of play is with respect to add-on components. Do other systems have anything like http://www.tmssoftware.com/site/ ?
Cross-platform - I personally use Linux for everything, but realistically, the majority of my users have Windows installations. So, cross-platform is "nice to have", "all other things being equal".
Now I have to pick a solution and stick with it for the next few years. Which one, given my points above (cost plays a role, but is not make/break)?
Thanks in advance for your help.
I have used both C++ Builder and Visual Studio.
Over the years I have always preferred C++ Builder over V.S.
Builder and VCL just feels much better designed than Microsoft's products.
(Even the Borland library source code just looks cleaner than anything
that comes out of Microsoft).
The integrated debugger in Builder is truely integrated and quite intuitive to use.
I find Builder compiles much faster than Visual Studio.
Builder 5 had a problem that made it unnecessarily slow,
but at the time it was still faster than VC++
and the latest Builder versions have faster compile times.
Accellerators such as TwineCompile make Builder even faster.
I've never tried to create custom C++ controls for Visual Studio,
but it is fairly easy to do in Builder.
Last year, CodeGear released a free version of TurboExplorer
(I haven't used it myself) which includes the IDE
and RAD (although limited) http://www.turboexplorer.com/
TurboExplorer can be used for commercial apps.
I have not been happy with Java based IDE's where are always slow.
I.e. SunStudio12 which is good (and free) but the UI is slow response.
I use Code:Blocks on Linux which has reasonable usability,
but haven't done any RAD work with it.
I never used C++ Builder but used to be a big fan/user of delphi. I normally work on server apps in c++, with some java. Reciently I started writing some small productivity apps for myself originally I used java, but then moved to Qt.
Now I love it. The library feels well designed just like vcl did in delphi. The signals/slots mechanism is great, I am still surprised how often I don't have to write code to wire up a dialog box. Using qt is easy and the code you write is very easy to read and create. I haven't yet had to write my own widgets, I think qt's model/view architecture splits the roles very well making the stock widgets very powerful. For example when using a QTableView most display and editing functions can be provided by the ItemModel, more powerful control is provided by an ItemDelegate. I have found these easier to reuse than writing custom widgets although it seems easy enough from looking at the documentation.
Qt creator is basic but does 95% of what I require, integrated project, gui designer, code, debug and help. Has support for CMake as well as qmake. It doesn't have advanced features like refactoring, but the intelli sense better than VS2005. However the next version of KDevelop looks very promising and will include these. You could also use eclipse if you wanted these features, or move between eclipse and qt creator as required. But I am very happy with qt creator.
On the cross platform issue, I develop my apps on Linux at home and tend to use them on windows in work. So far everything that works on linux works just work windows and looks like it was written for it too.
The strength of C++ Builder (and also Delphi) is the VCL GUI framework, it is easy to work with, and delivers true RAD development. There are a lot of alternatives to VCL which all have their strengths and weaknesses. The strength of VCL is the close ties with C++Builder/Delphi which makes it work very well with that combination. The downside is that it is propitiatory software, which means that you are unlikely to port your code to other IDE's or platforms without official support from Codegear/Embarcadero.
There is however some free alternatives out there, one of the more interesting being the Lazarus IDE. The Lazarus IDE is an IDE for the Free Pascal language, this is very similar to that of Delphi, I must admit that I am not a Delphi guy myself, so I am unable to go into too much detail about this. Lazarus have a GUI framework much like VCL called LCL. From the brief looks I've had on it, it looks very similar. There are several good things about the Lazarus/Freepascal package especially for your case. It is free, it can compile and build for both windows, linux, and mac, it has 64 bit support. Further more the compiler seems more modern than the Delphi one.
Lazarus running on Windows 7
Lazarus running on Linux (GTK2)
Lazarus running on Mac OSX
More screenshots can be found here: http://wiki.lazarus.freepascal.org/Screenshots
The problem with Delphi/C++Builder is that the VCL is not currently crossplatform capable. Although this is planned for future versions (as far as I recall) it is not yet implemented. Having noted that, there are some considerations as to whether the C++Builder will continue to be maintained or not, in here there is some comments on this: here.
Qt has been mentioned and it is indeed a very strong GUI framework and the Qt creator is a fine tool, personally though I like to have a very close bond between the IDE and the GUI framework like it is the case with the VCL, but that is very dependent on the developer.
Edit: Just a thought I had, when comparing C++Builder to other RAD IDE's it is easy to include IDE's for the .NET languages and Java. These use languages created for this purpose. C++ used in C++ Builder does, although in Borlands version slightly modified, not. This does raise an interesting question, is using C++ for RAD applications necessary and justifiable? Why not use a tool (language) that is written for the purpose. I am aware that C++ Builder is written for RAD development, but the language behind it was not designed for this purpose. If your need is truly rapidly developed applications, I would consider looking for other languages, but if you dependent on C++ for whatever reason, could be 3rd party libraries etc. Then C++ Builder is in the C++ world an excellent RAD development platform.
Short answer is NetBeans. It is cross platform, it is easy to use, although it is made-in-java but still it is fast.
PS: If you also do or intend-to-do programming in java, it will be convenient to use/learn this one IDE for both.
You can also use wxForms for C++ Builder and use wxWidgets to create cross platform applications. It works with the existing C++Builder IDE and make use of the same form designer.

Advice for C++ GUI programming

I have been writing C++ Console/CMD-line applications for about a year now and would like to get into windows GUI apps. For those of you who have taken this road before, what advice/tips can you give me. Ex: good readings, tutorials, approach tactics, etc...
I know this is a really broad question, but i really don't know how/where to start, thus not knowing how to ask this question properly.
I highly recommend the use of the Qt Libraries for several reasons:
The Framework is freely available for Windows, Linux, MacOS X, and a couple of mobile systems. Since version 4.5 the license is LGPL, which basically means that you can use Qt even in commercial applications.
The design of Qt is out-standing, e.g. they use modern design patterns and a very consistent interface design (I don't know many other libraries that use object-oriented ideas in such perfection). Using Qt is the same as using Boost: it will improve your own programming skills, because they use such beautiful concepts!
They are bloody fast, for instance in rendering (due to the different back-end for OpenGL, DirectX, etc.). Just have a look on this video and you see what can easily be done with Qt but is hard to achieve with native Windows, Mac, or Linux programming.
They have a really great documentation, with tons of tutorials and a very good reference. You can start learning Qt easily with the given docs! The documentation is also available online, so have a look and see by yourself.
As mentioned before, Qt is cross-platform; you have one source-base that works on all the important operating systems. Why will you limit yourself to Windows, when you can also have Mac and Linux "for free"?
Qt is so much more than "just" the user interface; they also offer network and database functionality, OpenGL bindings, a full-working web-browser control (based on WebKit), a multimedia playback library, and much much much more.
Honestly, I wasted a couple of years by developing software natively for Windows, while I could have been so much more productive.
For C++ you have two choices, Native or Managed.
For native development, my team (at Microsoft, in Windows) uses the Windows Template Library. It works very well for us.
You should learn the basics of Win32 and how Windowing works. The canonical tome is Programming Windows®
For Managed development you can use C++ with Windows Forms. However, windows forms has been supplanted by Windows Presentation Foundation (WPF).
Here is a good site that can get you up to speed.
This tutorial is useful
You can use Visual C++ 2008 Express Edition for your tools (they are free).
My best advice for Windows C++ GUI programming is don't do Windows C++ GUI programming.
I realize that is an extremely uninformative/smartass response if it's not qualified, so I'll note that you don't state that you need to do C++ Windows GUI programming, but that you "Would like to get into Windows GUI apps." If that is the case, and you don't have a very specific reason to use C++ (i.e. gigantic existing legacy codebase written in MFC or a bunch of C++ code that you want to build a front-end for but would be a pain to expose to .NET code), then it is going to be a lot easier and more productive to go the .NET route and start learning Windows Forms or better yet WPF using C# or another .NET language of your choice.
If you do need to go C++, then I would second the recommendations for 3rd party toolkits like Qt or wxWidgets, as the state of C/C++ GUI programming tools from Microsoft is now abysmal.
Most windowing libraries and technologies use similar idioms. Pick one and learn it.
The Windows Template Library is a very nice veneer for Microsoft Windows while sticking with C++.
For cross platform C++ windowing toolkits (they work on Microsoft Windows as well as other platforms) you can try QT or wxWidgets.
Well, for the Windows GUI, get used to referencing the MSDN a lot, assuming you want to deal with the API directly.
My favorite resource for learning the basics was theForger's tutorial, but there are hundreds of books and other sites out there.
I guess an important place to start is your toolkit. You tagged this visualc++, so I assume you are looking at that, however remember there are other toolkits like Qt.
I would suggest starting at Microsoft's tutorials.
+1 for Qt. I would put documentation at the top of my list of requirements for a GUI system. Qt has great docs and there's a huge community behind it. Also there are several books about it. Good docs are extremely important if you are working alone with no other team members to rely on. Alternatives are wxWidgets, MFC, WTL, FLTK and many more. They all have pros and cons. Eg FLTK is small and only provides GUI whereas Qt and wxWidgets also include networking, database access etc. Qt seems to have the most momentum at the moment after the Nokia buyout eg the release of Qt Creator which enables you to develop apps outside of Visual Studio.
It has been so long since I worked with C++ on Windows GUI, my word is always avoid C++ in Windows GUI unless you have a very good reason, I mean a good darn reason, if you need some performance C# is more than enough for 90% of the cases, and if you need more power write your performance critical thing in a C++ dll, and call it from a Windows Forms or WPF application.
It will save you hell of a lot time.
Still my opinion, if you have another I totally respect that
The first question is that do you want to develop Free, Open Source, for personal use or Commercial applications in C++?
If you want to develop for personal use! Then you can go with some good C++ Toolkit, Framework or API.
If you want to develop an GUI application that will be open source or free. Then you can go with C++ Toolkits, Frameworks or API's that have the GPL or any open source license that fits your needs.
Even you can develop Commercial applications with open source toolkits, frameworks or API's that have LGPL license.
The second question is that do you want to develop for the Windows, Mac, Unix or Linux? or these all, even for the mobile platform?
If you have a Windows user, as I am, and want to develop only for the Windows, I mean not for the cross platform, you can go with Win32 API, although, learning Win32 API is harder but it gives you the complete control over the machine. Believe me that no other tool would you provide the complete control over the machine. If you dislike Win32 API, for any reason, you can go with MFC, which is another technology from Microsoft, but is not free, old and has less attention now a days. If you decide to develop with .NET platform, you have C++/CLI, an extension to C++ language for developing .NET applications. .NET gives you the type safety, OOP and a built in garbage collector, provides you the all API's related to Windows and x86 or x64 machine in one package.
.NET has its own world! Microsoft has decided to port .NET to other operating systems too, Mono project is an example... You can develop nearly all kinds of applications using .NET.
If you want to develop C++ GUI applications for the cross platform, then Qt, WxWidgets and U++ are available for your help. You can write once and deploy anywhere with these libraries. Many open source IDE's and compliers are also available to develop C++ applications with ease. Note that if you do not want to develop for the cross platform, any cross platform library would be overhead and unavoidable increase in size of the executables.
Is your C++ knowledge is good enough to program software systems?
In fact, if your knowledge of C++ is not enough deep and you do not understand programming methods like OOP, Encupsolation, Classes, Interfaces, Types, Programming Patterns and so on, you can not use any toolkit with full potencial.
Do not forget that every Toolkit, Framework or API is implemented in some programming language. If you do understand the language very well, you can use the toolkit very well. I think, you would understand my point.
Put aside WPF or VC++ or Qt, You can also try out several libraries such as :
OpenFrameworks
Processing
...
there's an active project for developing Gui with Openframeworks here:
http://www.syedrezaali.com/blog/?p=2172
Are you familiar with Microsoft Visual Studio and .NET technologies? Since you want to develop for Windows platforms why don't you start by taking a look at Microsoft Visual C++ Express Edition.? Explore a little with the available tools from MS and search for some tutorials.
We are in 2020 but the question is still pertinent. I agree with Qt users, it's a great framework.
However, there is also C++Builder that offers you design GUI visually at design-time. C++Builder application can be built on both VCL (Windows only) and FireMonkey (cross-platorm) frameworks. Clang compiler can produce both 32 and 64-bits native executables. Community edition of C++Builder is free. Delphi integration is seamless: C++Builder project can include Delphi files directly and use any existing Delphi component packages and libraries.

Should I use a cross-platform GUI-toolkit or rely on the native ones?

On my side job as programmer, I am to write a program in C++ to convert audio files from/to various formats. Probably, this will involve building a simple GUI.
Will it be a great effort to build seperate GUIs for Mac and Windows using Cocoa and WinForms instead of a cross-platform toolkit like Qt or GTK? (I will have to maintain a seperate Windows-version and Mac-Version anyway)
The GUI will probably be very simple and only need very basic functionality.
I always felt that native GUIs feel far more intuitive than its cross-platform brethren...
If you have the expertise, use native frontends, it'll effectively double the job you have to do for UI but from my experience non-native UI is a little bit clunkier than their native counterparts.
Have you looked at wxWidgets? Cross platform native controls.
I would agree that if possible, native front-ends are the way to go. I've not used wxWidgets recently, and I've heard it's come a long way, but back when it was wxWindows, we built an app with it that was spec'd to be built in X/Motif. When we finished the effort and delivered it, the customer said it did not look enough like X/Motif, and we had to re-work the entire UI at our expense... Joel Spolsky wrote a good article on this, but I can't remember the title. What he did say, IIRC, was the problem with Java and some other cross-platform UI was that "your dog barks at my app" - it's the little inconsistencies that annoy folks.
Cross-platform toolkits, more or less, all make the incorrect assumption that the difference between platforms is a matter of button placement and widget styling. In some cases you can get away with this - a Qt app will feel fairly native on both Windows (where UI conventions are very lax) and on Linux, particularly a KDE environment. In general, you can move between Linux and Windows relatively easily; conventions are similar, and the Windows community is lax about them.
Mac is the hard one. Its UI is built around an entirely different paradigm than either Windows or most Linux environments.
But in general, in a native app it's easier to speak the native language of the platform in more ways than just widget style.
Yes.
But seriously, it depends on your goals. I agree that the native UI libraries, with a bunch of effort put into them, will give vastly better results, but for lots of apps, a very basic UI is sufficient and a lot less effort if you take one of the existing cross platform frameworks.
Maybe starting with the CLI and getting functionality working makes the most sense for an audio conversion application.
I'm going to write my own cross platform application GUI layer for this soon.
Depending on the complexity of your application this can be a fraction of what is required for QT, GTK or FOX.
Reason is that we see a tendency that the platform vendors (Apple first) tries to design there system so that it looks unique. This makes it much harder for QT, GTK, FOX and other platform tools to constantly keep in sync with the latest widgets.
When the underlaying technique becomes more and more the same the OS vendors have no option then branding on look and feel of the platform.
wxWidgets used standard c++ syntax and preprocessor thus make you easily alter from plain C or C++. And will produce very native look where is appear, be it on GTK, X11, MS-Windows or Mac.
It's mature since 20yrs of 1rst release, has complete documentation with easy navigating, and supported by large community arround the world.
Coding in your favorite IDE or use prominent Eclipse-IDE and wxFormBuilder as GUI designer. Build wx library and IDE/Toolchain setup could be found on this link: http://yasriady.blogspot.co.id/2016/01/raspberry-pi-toolchain.html
Develop your application in Linux desktop and also provided compiler for Raspberry Pi2 (target application tested work smootly on Raspbian Jessie) ............