Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2010
    Posts
    1

    How to create windows App.

    Hey everyone,
    I've been writing c++ for about a month now and have a good hold on the basics such as loops, class's, and methods. I am clueless though as to how to write something that isn't executed from command prompt. To begin with I'd just like to create a program that simply opens a window with a colored background and has "hello world" printed in the middle.

    All help and feedback is greatly appreciated

  2. #2
    Join Date
    Nov 2008
    Posts
    397
    basically you have several choices

    considering what you have accomplished you have 2 choices in my mind

    Designer based
    code based

    Designer based relies on editors and visual creators like the traditional create a form and drag and drop buttons and stuff onto it, MFC is a good example of this in which C# has taken the cross between C++ and visual basic and made a very dynamic language (the best of both basically)

    MFC is a difficult library of lots of **** but is extremely powerful once you learn it.

    Code based, example Win32 is designing window almost at the very basics. everything is coded, apart from menu's there is no designers. the benefit of Win32 is that its extremely educational into how Windows (in this case) works and how application works at a very high level

    A thing to note is win32 is an API not C++ BUT if you create a C++ win32 application you can use your classes etc in conjunction with the API creating very fast applications.

    In addition I learnt win32 first and then moved to MFC because you can use Win32 in MFC

    ontop of that you could get QT Pro which costs a bit but is a library that works with windows and linux

    but eitherway it really does depend on how much coding you want to do and how much designing and fancy stuff
    Last edited by sarriss2; 12-03-2010 at 05:53 PM.

  3. #3
    Join Date
    Jun 2008
    Posts
    1,088
    Good information. I was curious about this myself since I am pretty much in the same boat. I have never written anything that opens.into a program. All of my stuff has been done in game engines so this has been informative to me as well... so thanks!

    -Dane

  4. #4
    Join Date
    Nov 2008
    Location
    41° 28′ 56″ N, 81° 40′ 11″ W
    Posts
    2,399
    True...for the longest time doing a full-out Windows App in C++ was a complete nightmare until just recently. I've usually used C++ to write console/DOS apps and I've usually used Visual Basic, of all languages, to write Windows Apps, and perhaps some C# as well from time to time. Now it seems to me that this seems to be something that sarriss2 has brought up, and it's a very good point. C# is a really good middle ground language which will take both from what you have from C++ and what you have from VB.NET and fuse those two together to bring that all-around experience. That I can agree with.
    PC Specs: Antec 900 ATX Case, Gigabyte 790GX Mobo, AMD Phenom II x4 955, Corsair HX620W PSU, Corsair Vengeance 16GB (4x4GB) DDR3-1600, EVGA GTX 680 2GB GDDR5, 3D Vision Kit 2, LG 8x Blu-ray Burner, Intel X25-M SSD, 500GB+640GB WD Caviar Blacks, Win 7 Pro x64, DAS Pro K/B, MX518 Mouse, Logitech Z-2300 Speakers, Toshiba 32TL515U 32" 3DTV, Wacom Bamboo Fun Large Tablet.

  5. #5
    Join Date
    Jun 2003
    Location
    Trier, Germany
    Posts
    1,350
    Quote Originally Posted by sarriss2 View Post
    A thing to note is win32 is an API not C++ BUT if you create a C++ win32 application you can use your classes etc in conjunction with the API creating very fast applications.
    A quick note on terminology: APIs are independent of languages, there can be C++-APIs as well as C-APIs. Win32 is a C-API so there are some pitfalls when wrapping it in C++ language concepts.

    In addition I learnt win32 first and then moved to MFC because you can use Win32 in MFC
    I'd even go as far as to say that you can't become a decent MFC programmer without knowing at least the basics of Win32-API. In any case, it sure as hell makes getting started with MFC a whole lot easier (but still painfully hard ).

    A third way to go is the .Net-based APIs WinForms and WPF (fka Avalon). The main disadvantage with these is that you need to interact with them through managed code wrappers, so you may as well code the whole UI-part with C# (which is a lot more comfortable, unless you really need the additional level of control in C++).

    ontop of that you could get QT Pro which costs a bit but is a library that works with windows and linux
    Or you could get Qt LGPL which doesn't cost a thing
    Nokia actually offers two licensing models for Qt, one commercial and one non-commercial. Remember that Linux's KDE is based entirely on Qt, which helped build up the pressure to make them provide an open-source license.

    Honestly: If you just want to get things done (as opposed to: want to understand how windows ticks internally) prefer Qt or a comparable framework over the native APIs. Qt is a *lot* easier to use (and imho also more fun) than the native solutions and on top of that, it enables you to port your applications to Linux or Mac effortlessly.
    Qt also comes with the advantage that it offers both designer-based and code-based approaches under the same hood, which works remarkably well: Use the designer to get things running quickly, then get down in the code if you need full control.

  6. #6
    Join Date
    Nov 2008
    Posts
    397
    A thing to note ComicSansMS is that QT LGPL version you cant tie in with visual studio, and comes with a lot less features but as a start the free version is very good, very robust and as you say very entertaining to use

  7. #7
    Join Date
    Jun 2003
    Location
    Trier, Germany
    Posts
    1,350
    Quote Originally Posted by sarriss2 View Post
    A thing to note ComicSansMS is that QT LGPL version you cant tie in with visual studio, and comes with a lot less features but as a start the free version is very good, very robust and as you say very entertaining to use
    not sure what you mean. the qt visual studio add-in is available for free download and may be used with the lgpl version. afaik the only advantage the commercial license gives you, is that it relieves you from the bounds of the lgpl (i.e. mainly the need to share all changes made to the qt source code).

  8. #8
    Join Date
    Nov 2008
    Posts
    397
    :O didnt see that add on :O is that new?

  9. #9
    Join Date
    Jun 2003
    Location
    Trier, Germany
    Posts
    1,350
    Quote Originally Posted by sarriss2 View Post
    :O didnt see that add on :O is that new?
    it's been there for a while. but i admit it can be easily overlooked, given how crowded the qt page is in places...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •