tags:

views:

71

answers:

4
+1  Q: 

windows apps

Hello am new to c++ from php. Although i am not an absolute newbie, meaning i have programmed large db driven apps using oop php and sql, i would like to know what the general process of creating stand alone windows applications using c++ is as far as patters, APIs compilations etc...

EDITED: As far as GUI how would you the visual interface of something like firefox. How do you create the looks, because it doesn't quite look like the AWT lib like in visualc++?

A: 

I think your question is way too broad. Try to break it into smaller chunks, like questions about getting started with GUI programming on windows, questions on patterns, questions on forming an API, etc.

JoshJordan
+5  A: 

I think you should really pick up a copy of Programming Windows 5th Edition by Charles Petzold to help you with a lot of this background information.

BobbyShaftoe
A: 

His question was intentionally broad: quote "I would like to know what the general process is."

To the OP: First you need to decide if your going to be using the console or building an app with gui support.

For most of the hello world tutorials you find they should run fine on any platform as long as they have access to a console of some kind.

Once you understand how C++ works and how to build simple programs you can start studying the windows librarys that provide you with the GUI and whatnot.

So to start get yourself a C++ compiler (DevCpp at www.bloodshed.net is good) and do the basic hello world and whatnot.

Then its a matter of implementing whatever you want from windows.h and other includes.

As for APIs this would depend on the type of program you want to make: for image/sound/input (ie games/imageviewers/mediaplayers) you should learn the Standard Development Library or SDL.

For doing GUI you can use the windows APIs as per above or check out Qt at www.qtsoftware.com or wxWidgets at www.wxwidgets.org

as a bonus if you refrain as much as possible from using the windows APIs your program will be much easier to port.

SDL, Qt, wxWidgets are all cross-platform.

+1  A: 

Microsoft libraries:

From unmanaged C++ you can use either native Win32 API, MFC or ATL/WTL.

The native Win32 API is a collection of C-style methods exposed by the Windows family of OSes. These APIs work by manipulating windows and message loops. You can start reading about Win32 in the MSDN Windowing section.

MFC is a C++ class library which provides rich object-oriented wrappers around the Win32 APIs. It abstracts the Win32 windows as CWindow class and message loops as CMessageMap. You can read more about MFC on MSDN.

ATL/WTL is a lightweight C++ template library, which started as a C++ wrappers for COM and later adopted some ideas from MFC (thus sharing the same classes names) for support of Win32 windowing. The ATL windowing support was later split into WTL, which was then released as open source. The ATL windowing support is documented on MSDN in the ATL Window Classes section.

From managed C++, you can use either WinForms or WPF. Both are fairly thoroughly covered on MSDN, although their documentation and samples are heavily skewed towards C# and VB.Net. I personally would also recommend you look at C#, if you want to explore these UI platforms.

What you need to use these:

Of course, first you need a C++ compiler. :-)

To use the Win32 APIs, you only need the Windows SDK and optionally Visual C++ Express.

To use MFC and ATL, you need one of the Visual Studio Professional or above editions. ATL and MFC are not included in Visual C++ Express. (ATL/MFC might be included in the WIndows SDK or other free products that I am not aware of.)

WTL 8.0 is available as a free download. You can also get WTL sources from Source Forge WTL project.

To use WinForms or WPF, you need the latest .Net framework (well, tehcnically you need any .Net framework :-)) and optionally Visual C#/VB.Net Express. I am not sure if Visual C++ Express supports managed C++.

Third-party options:

There are several third-party C++ libraries that wrap/abstract the native Win32 APIs. Some of them are sufficiently abstract to allow developing UI not ony for Windows, but other platforms as well. Qt and wxWidgets are couple I know of, but have never used.

Franci Penov