When I create a 'Windows Forms Application', the resultant program is a managed one. Creating a 'Win32 Application' results in a native one, but when I try to add a form I'm informed that the project will be converted to CLI if I continue. How do I design a native Windows GUI with Visual C++ 2008 Express Edition? I'm probably being very silly here, but I just can't figure it out.
Either use MFC, WTL, or straight Win32 API. You can't use forms (or any of .NET) without switching into managed code.
MFC is Microsoft Foundation Classes - the most common C++ windows library
WTL is Windows Template library - a better C++ windows library IMO
Win32 is CreateWindow, DialogBox, etc, everything else is a wrapper around the Win32 api.
You just need to avoid the managed libraries. Most likely, this will mean using MFC for the GUI, instead of Windows Forms. For details, see MSDN's MFC pages.
Unfortunately, VC++ Express Edition doesn't support MFC directly, so you'll have be more limited. It is possible to compile MFC projects using the Express Edition, but you lose all of the Wizards, etc. If you are serious about doing non-managed GUI development, you should consider upgrading to a higher level SKU.
Another option would be to use Qt for for GUI. It is now LGPL, so usable, for free, in even commercial C++ projects, and includes a full designer.
This is an answer to the linked question. Unfortunately, that has been closed by Robert Harvey because he thinks it is a duplicate. It is not, sorry Bob.
The best library for creating xll's is http://xll.codeplex.com. You can use that to create rudimentary user interfaces using Excel macros. One example of that can be found in the ALERT.FILTER macro in xll/error.cpp
As Reed Copsey, MFC would be the "default" way of creating a native unmanaged GUI on the Windows platform. However, MFC is not included with Visual Studio Express. Consequently, you would either need to upgrade to the full version or you could look into using a freely available C++ GUI library such as wxWidgets.
There is also wxFormsBuilder if you want a GUI editor.
You could also go down to the "bare metal" and code right to the Win32 API, maybe take some help from the common controls library. But you'll be entering a world of pain ;)
You would need to use a native application framework. For Windows this means MFC or the bare Win32 libraries. WinForms use .NET libraries in the background and therefore need to be managed.
Native applications don't use "forms". For a native application, you could create, for example, an MFC application. If you want it to be something like a form-based application, you can tell the wizard you want a dialog-based application, or (on the last page of the Wizard) have your view derive from CFormView instead of CView.
Alternatively, you might want to use WTL -- though that means writing essentially all your code by hand instead of using wizards and such.
Windows Forms is the name given to the graphical application programming interface (API) included as a part of Microsoft's .NET Framework, providing access to the native Microsoft Windows interface elements by wrapping the existing Windows API in managed code.
Wikipedia
Most of the above answers explain things pretty well - if you want to look into creating a pure Win32 Native App form (no MFC/WTL etc) take a look at the tutorials here: http://www.zetcode.com/tutorials/winapi/ for starters. That's the third time I've linked to this site on here, but his tutorials are very good.
Note - at this stage there's nothing "visual" about it except the result - it is all done in code, although that said I don't think it is too difficult really. It will definitely be good programming experience.
Windows Forms are a GUI framework written in managed code, so you cannot use Forms in a native application.
With a native application, you have to create windows. Programming Windows by Charles Petzold is the definitive how-to book for this. It's a lot of work compared to using a good framework. MFC (Microsoft Foundation Classes) is a framework for native Windows GUIs. I don't know if it comes with VC++ Express.
I noticed that no one mentioned JUCE which can be used to build cross platform user interfaces in C++. I thought it was pretty cool. Looks like it's been expanded to support mobile devices too since I used it.
Personal and Educational licenses are free. 'Pro' and 'Indie' licenses are relatively cheap.
Related
I want to make a Windows Phone app (version 7.5 and 8 preferably) in C++. I searched the net and came to know that for this purpose XAML is not supported and I will have to generate the UI from C++ itself, which I don't know how to. But in Windows Store apps, UI is generated by XAML and code-behind by C++/CX, which I find better. Is it possible to use C++/CX and XAML for the purpose or if you can give some resource on generating UI with C++?
Check out these links:
http://social.msdn.microsoft.com/Forums/en-US/wpdevelop/thread/98475feb-076f-434d-a5c8-24c8ccc4c9c0/
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj681687%28v=vs.105%29.aspx
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj681693%28v=vs.105%29.aspx
I would encourage you to:
Write your main project in C# (using XAML)
Invoke (native, unmanaged) C++ modules as needed (for performance)
And please remember that XAML itself isn't necessarily portable between platforms.
As far as I know there are libraries for C# and VB.net for Windows Phone. XAML is very easy to use so you will not lose anything to write some. Also you have to think if your app will pass certification. So better speak with the support team of windows phone to get some help.
I am a noob C++ Programmer.
I want to develop GUI applications. I am using Visual Studio 2010.
Normally, Visual Studio Projects begin with the old style interface with a frame with a menu in it. But I want to build an application with more rich Graphical elements. Just like the windows 8 start screen.. or the Visual studio start page. Please teach me how to do those fancy effects.
Edit: I don't like to use flash or JavaFX Java because they need additional programs to be installed before using.
Well, basically you have not much options here. Regarding to your choice (MS Visual Studio) they are:
MFC/C++ - not convinient at all, I can say it's a small pain in the ass. But a lot of program were written exactly with a help of MFC library. It's a canonical way :)
Windows Forms/C++ - actually it's not usial C++, but C++/CLI. Not so much different, but has a few things to note. You can take a look at C++/CLI Cheat Sheet for example. Not usial, but, hey, you can use Windows Forms!
Windows Forms/C# - as for me, this combination is almost perfect. Nothing to add.
WPF/C# - even much more interesting. Any control can be modified in any way, but you have to know a lot of tricks and howtos to make all things work. In that case I highly suggest to use WPF Toolkit. Anyway, you can find a lot of cool stuff for WPF (I even made once a mini-SCADA with a bunch of UI elements related to industrial stuff (valve, pumps, etc.)). Do not forget, you can do animation as well. It is pretty easy.
Qt addon for MSVS/C++ - the last but not the least option. All UI you make in Qt Quick - GUI IDE. Also you have a greatiest slot/signal interaction model (which was improved in Qt5.0).
My choise now is definitely Qt. It's crossplatform, btw.
For C++ you can create a WinForms (Windows Forms) project.
But nowadays WPF is preferred over WinForms, and WPF is usually used from C# or VB.NET. I'm not sure if it's possible to use from C++, but if so it would have poor support. C# is pretty easy to learn if you already know C++.
If you want to create Windows Store apps in Windows 8, you can also use C++/CX, but that requires VS 2012.
So you really want to make flashy things like these, eh? Well, you can make a Windows Store app, but like previously mentioned it requires Visual Studio 2012.
Take a look at this question too: How to develop unique GUI's in Visual Studio?
You have several options of GUI from which you can choose wxWidgets, Qt, Ultimate++.
or u can use Embarcadero C++ Developer ----> actually Firemonkey is so amazing check it out
C++ Builder
i like to build desktop application , that will be must user friendly in view
what i mean is that the look and feel will be natural in the way the user used to see windows
apps .
and this toolkit/framework to be as much as possible easy fast to develop from the developer side in c++ .
Could we ask some more questions, what do you mean by user friendly(system integration easy keybingings/Accessibility)?
Which platforms(windows only? You seem to indicate this, if so xp-7?
Would fairly easy crossplatform support be a plus))?
Do you want a form builder? an ide? special libraries?
open source or closed source?
do you mind paying?
qt is probably the most recommended
option although there is also
FLTK
Juce
wxwidgets
gtk+(c based or use with gtk-- a c++ wrapper)
I'd go with Qt.
It's a mature cross platform library that is easy to setup and to use. There's also a ton of resources available. The QT designer can also help you to quickly create your forms. There's even a visual studio plugin for it!
As others have pointed out Qt is a great choice. I went through the same search when I started coding C++ coming from Delphi, and this is where Qt shined. It was the only option I found that offered a complete solution: GUI, DB access, cross-platform system calls (file-access, start-processes), XML, native platform configuration (text files in *nix, win-registry, etc), multi-threading.
It was a one-stop shop for everything I needed.
I see many user interface control libraries for .NET, but where can I get similar stuff for win32 using simply C/C++?
Things like prettier buttons, dials, listviews, graphs, etc.
Seems every Win32 programmers' right of passage is to end up writing his own collection. :/
No MFC controls please. I only do pure C/C++. And with that said, I also don't feel like adding a multi-megabyte framework to my application just so that I can have a prettier button.
I apologize for leaving out one tiny detail, and that is that my development is for Windows Mobile.
So manifest files are out.
I just notice how many developer companies have gone crazy with making pretty looking .NET components and wondered where the equivalent C/C++ Win32 components have gone?
I read about how many people ended up writing their own gradient button class, etc. So you would think that there would be some commercial classes for this stuff. It's just weird.
I'll take a closer look at QT and investigate its GUI support for such things. This is the challenge when you're the one man in your own uISV. No other developers to help you "get things done".
I've used Trolltech's Qt framework in the past and had great success with it:
In addition, it's also cross-platform, so in theory you can target Win, Mac, & Linux (provided you don't do anything platform-specific in the rest of your code, of course ;) )
Edit: I notice that you're targeting Windows Mobile; that definitely adds to Qt's strength, as its cross-platform support extends to WinCE and Embedded Linux as well.
The Code Project has lots of UI controls for C/C++
Most of them are focussed on MFC or WTL but there are some that are pure Win32.
As an aside if you're not using a framework, you really should consider WTL over pure Win32. It's low overhead and about a million times more productive.
For prettier buttons, etc., if you aren't already doing it, embed an application manifest so that your program is linked to version 6 of the common controls library. Doing so will get you the Windows XP- or Vista-styled versions of the standard Windows controls.
If you want types of controls beyond what Windows offers natively, you'll likely have to either write it yourself or be more specific about what kind of control you are looking for.
I you don't mind using the MFC libraries you should try the Visual C++ 2008 Feature Pack
Stingray
CodeJock - Toolkit Pro for MFC/ C++
The MFC feature pack is derived from BCGSoft components.
Using winAPI's you can do almost anything you want and really fast too. It takes some time to figure it out but it works. Go to MSDN, lookup MessageBox(), check out DialogBox() and go from there.
I personally do not care for MFC by the way. If you want to use an MFC like approach I'd recommend Borland's C++ Builder. Pretty old but still very usefull I think.
Now that I know C++ I want to get into desktop application that have a UI instead of Command Prompt stuff, where should I start?, and what are some good online resources?
wxWidgets is a cross platform GUI library for C++ (and other languages). The main site should have enough pointers to resources to get going.
You might also want to check out this question/answer here on stack overflow if you are specifically thinking of Windows
If cross platform support is important then I would second the suggestion to look at Qt. It supports Windows, Linux and the Mac. For free software it is free (there is a GPL version on Unix but not for Windows) but for comercial software it is not particulary cheap. There are now several books on Programming with Qt.
It does come with a large number of extra libraries for networking, parsing XML etc. It also has integration with Visual Studio on Windows.
One downside with Qt is that there are not as many add on libraries as with some other GUI frameworks. Ot will depend on the type of applications that you wish to write whether this is important to you or not.
I use Codegear's C++ Builder. It's C++ language support is not 100% but it more than makes up for it by having a great two-way RAD IDE and the ability to use a huge library of existing Delphi components.
How about QT? Its cross-platform and its is used in a lot of commercial softwares.
On Linux and maybe Windows, you can use Gtk+ with Glade. Gtk+ is the GUI toolkit. Glade is a GUI drag and drop GUI editor. If you came from Windows or Java and thought GUI programming is hard, this stuff is easy.
If marketability is a concern, then C++/CLI with WinForms and WPF which really translates to "just learn WinForms and WPF, regardless of what specific language you use".
CodeProject has a ton of WinForms/WPF samples/tutorials to get you started.
The Fox GUI Toolkit
Really decent tried-and-true toolkit with a very nice event system. I've used the Ruby port, and my Windows apps had a very native look and feel.
It might lack some features, but FLTK is an incredibly simple cross-platform GUI library.
If you are using Windows the traditional place to start is Petzold
There is a nice simple framework here which will help you on the way without abstracting too much away.
Get Visual Studio Express, and start with a MFC "Dialog Based" application. All the window toolkits mentioned are good, but MFC will look the best on a resume!