1. #1
    x BlueRobot's Avatar
    Join Date
    May 2013
    Location
    Minkowski Space
    Posts
    1,872

    [Visual C++] Windows Programming Tutorials?

    Those anyone know where to find any good Windows programming tutorials for C++? I mean write Visual applications, the MSDN documentation is okay, but doesn't really explain much and how to implement the code properly.
    Machines Can Think

    We don't make mistakes; we just have happy accidents.


    • Ad Bot

      advertising
      Beep.

        
       

  2. #2

    Re: [Visual C++] Windows Programming Tutorials?

    Well, I have no idea how far you've gone by know with your C++ knowledge, but if you plan on starting from the beginning, these tutorials provide great explanation of basic stuff like, if statements, loops, etc.
    C++ Tutorial - Learn C++ - Cprogramming.com

    When programming, unless you aim to work with it, you don't really have to learn the language all out before making your first app, just continiue on until you hit a wall, google it.
    If google don't have answers, ask some friends or make a thread about it. Also, you will have alot of advantage knowing a low level language while working with C/C++ native.

    Thing with programming is that, the more you read, the more you know, it's as simple as that, as long as you understand what you are reading.

  3. #3
    AceInfinity's Avatar
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    1,725

    Re: [Visual C++] Windows Programming Tutorials?

    You'll need to understand much of the Win32 API and how to use graphics and manage Windows Messages in a message loop. Going with custom GUI graphics without any framework like Qt can be a bit daunting at first, and if you don't have some kind of model to manage your GUI and handle events properly for you, it can degrade performance and even turn into a nightmare if you have to manually manage more of the GUI portion than necessary in parts of your code that are meant to actually perform tasks that make your program useful to the end-user.
    Automation Programmer
    Microsoft MVP [2012 - 2018]

  4. #4
    Jared's Avatar
    Join Date
    Feb 2014
    Age
    21
    Posts
    1,583
    • specs System Specs
      • Manufacturer:
        Custom
      • Motherboard:
        ASUS Maximus VII Ranger
      • CPU:
        i7 4790K @ 4.4GHz
      • Memory:
        Corsair Vengeance 16GB 1866MHz
      • Graphics:
        MSI Gaming 4G GTX 980
      • Sound Card:
        Creative Soundblaster ZxR
      • Hard Drives:
        Samsung 850 SSD 250GB
      • Disk Drives:
        Western Digital Black Caviar 2TB
      • Power Supply:
        Corsair RM650 Modular 650 Watts
      • Case:
        Fractal Design Define R5 Window
      • Cooling:
        Corsair H100i GTX
      • Display:
        Dell U2515H 25inch 2560x1440 + LG Flatron M2262D 22inch 1920x1080
      • Operating System:
        Windows 10 Professional x64

    Re: [Visual C++] Windows Programming Tutorials?

    This thread is two years old if you haven't noticed.

  5. #5
    AceInfinity's Avatar
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    1,725

    Re: [Visual C++] Windows Programming Tutorials?

    Quote Originally Posted by Jared View Post
    This thread is two years old if you haven't noticed.
    An old thread doesn't mean that more can't be contributed to the topic. IMO it's much better than having a new thread with information on topic with an existing thread than to have it all consolidated within a single thread so that people don't have to search the entire forum just to find relevant information.
    Automation Programmer
    Microsoft MVP [2012 - 2018]

  6. #6
    Jared's Avatar
    Join Date
    Feb 2014
    Age
    21
    Posts
    1,583
    • specs System Specs
      • Manufacturer:
        Custom
      • Motherboard:
        ASUS Maximus VII Ranger
      • CPU:
        i7 4790K @ 4.4GHz
      • Memory:
        Corsair Vengeance 16GB 1866MHz
      • Graphics:
        MSI Gaming 4G GTX 980
      • Sound Card:
        Creative Soundblaster ZxR
      • Hard Drives:
        Samsung 850 SSD 250GB
      • Disk Drives:
        Western Digital Black Caviar 2TB
      • Power Supply:
        Corsair RM650 Modular 650 Watts
      • Case:
        Fractal Design Define R5 Window
      • Cooling:
        Corsair H100i GTX
      • Display:
        Dell U2515H 25inch 2560x1440 + LG Flatron M2262D 22inch 1920x1080
      • Operating System:
        Windows 10 Professional x64

    Re: [Visual C++] Windows Programming Tutorials?

    No, I'm not saying that it can't be contributed more.
    I'm just pointing it out in case you missed it.

  7. #7
    AceInfinity's Avatar
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    1,725

    Re: [Visual C++] Windows Programming Tutorials?

    Quote Originally Posted by Jared View Post
    No, I'm not saying that it can't be contributed more.
    I'm just pointing it out in case you missed it.
    Why though? It's only less than a month old, but there were no previous replies either. I think it's fine :)
    Automation Programmer
    Microsoft MVP [2012 - 2018]

  8. #8
    niemiro's Avatar
    Join Date
    Mar 2012
    Location
    District 12
    Posts
    7,868

    Re: [Visual C++] Windows Programming Tutorials?

    Quote Originally Posted by AceInfinity View Post
    Quote Originally Posted by Jared View Post
    No, I'm not saying that it can't be contributed more.
    I'm just pointing it out in case you missed it.
    Why though? It's only less than a month old, but there were no previous replies either. I think it's fine :)
    Technically a month and two years, but close enough

    I think it's fine though - good content is good content. If it's triggered an interesting discussion as this precisely has, what does it really matter if the original post was a couple of years old. I think that our focus should be on generating good content, not worrying too much about the how :)
    AceInfinity says thanks for this.

  9. #9
    AceInfinity's Avatar
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    1,725

    Re: [Visual C++] Windows Programming Tutorials?

    Quote Originally Posted by niemiro View Post
    Quote Originally Posted by AceInfinity View Post
    Quote Originally Posted by Jared View Post
    No, I'm not saying that it can't be contributed more.
    I'm just pointing it out in case you missed it.
    Why though? It's only less than a month old, but there were no previous replies either. I think it's fine :)
    Technically a month and two years, but close enough

    I think it's fine though - good content is good content. If it's triggered an interesting discussion as this precisely has, what does it really matter if the original post was a couple of years old. I think that our focus should be on generating good content, not worrying too much about the how :)
    I suppose I'm still living in 2013. :)

    (I quickly glanced at the month, forgot about the year. I wonder if I'm already getting old, or if I was just really tired. )
    niemiro says thanks for this.
    Automation Programmer
    Microsoft MVP [2012 - 2018]

  10. #10
    Jared's Avatar
    Join Date
    Feb 2014
    Age
    21
    Posts
    1,583
    • specs System Specs
      • Manufacturer:
        Custom
      • Motherboard:
        ASUS Maximus VII Ranger
      • CPU:
        i7 4790K @ 4.4GHz
      • Memory:
        Corsair Vengeance 16GB 1866MHz
      • Graphics:
        MSI Gaming 4G GTX 980
      • Sound Card:
        Creative Soundblaster ZxR
      • Hard Drives:
        Samsung 850 SSD 250GB
      • Disk Drives:
        Western Digital Black Caviar 2TB
      • Power Supply:
        Corsair RM650 Modular 650 Watts
      • Case:
        Fractal Design Define R5 Window
      • Cooling:
        Corsair H100i GTX
      • Display:
        Dell U2515H 25inch 2560x1440 + LG Flatron M2262D 22inch 1920x1080
      • Operating System:
        Windows 10 Professional x64

    Re: [Visual C++] Windows Programming Tutorials?

    Sorry for reviving a thread I said not to do earlier (hypocritical, yes).
    Do you have any recommendations for learning the Win32 API?

    I've started with a bit of Win32 programming (A blank window), but I've hit a dead end with where to go next.

  11. #11
    xilolee's Avatar
    Join Date
    Dec 2013
    Location
    World, Europe, Italy
    Posts
    2,235
    • specs System Specs
      • Manufacturer:
        XILOLEE.com
      • Model Number:
        XILO
      • Motherboard:
        ASROCK FM2A88M Pro3+ chipset A88X Bolton-D4
      • CPU:
        A10-7800, 4 CPU, 4 thr, 65/45W, FM2+, 28nm, Steamroller/Kaveri
      • Memory:
        10GB (Nanya and kingston ddr3-1333 9-9-9-24)
      • Graphics:
        Radeon R7 720MHz (8 GPU cores, integrated in CPU)
      • Sound Card:
        RealTek ALC662 (integrated in MB)
      • Hard Drives:
        Seagate ST500DM002-1BD142 500GB 7200RPM
      • Power Supply:
        SuperFlower 450W 80+ Platinum (SF-450P14PE)
      • Case:
        Sharkoon VG4-S
      • Cooling:
        Realtek RTL8111GR (NIC integrated in MB)
      • Display:
        Samsung SyncMaster SA100 LS22A100NS-EN
      • Operating System:
        Windows 10 Home/Standard x64

    Re: [Visual C++] Windows Programming Tutorials?

    Charles Petzold's Programming Windows, 5th Edition, and Kernighan-Richie "The C Programming Language", 2nd edition, are a must.
    By the way, I'm not a programmer...

  12. #12
    niemiro's Avatar
    Join Date
    Mar 2012
    Location
    District 12
    Posts
    7,868

    Re: [Visual C++] Windows Programming Tutorials?

    Quote Originally Posted by xilolee View Post
    Charles Petzold's Programming Windows, 5th Edition, and Kernighan-Richie "The C Programming Language", 2nd edition, are a must.
    By the way, I'm not a programmer...
    The first of those books was published in 1998, the second in 1988. Irrespective of how good they are (in fact the Kernighan-Richie book is very good), they're not exactly modern. Computers and computer programming has moved on hugely since the times of Windows 2.0/Windows 98. I would stress to all the vital importance of learning C++ especially from a book which teaches the most up to date and modern programming techniques (which is not quite the same as being published this year...there are a lot of bad books out there). C++ hasn't changed all that much in recent years but the way we use it really has.

    For book recommendations see here - c++ faq - The Definitive C++ Book Guide and List - Stack Overflow

    Also, Jared, what are you trying to program?
    A .net style GUI? How good is your C#?
    A .net style GUI coded without using .net?
    A 2D platformer game? Full 3D game?
    A composite window with standard UI elements but also a 3D graphics drawing area (like a chemistry app which shows details of a molecule and then a 3D rotating graphic of its structure).

  13. #13
    xilolee's Avatar
    Join Date
    Dec 2013
    Location
    World, Europe, Italy
    Posts
    2,235
    • specs System Specs
      • Manufacturer:
        XILOLEE.com
      • Model Number:
        XILO
      • Motherboard:
        ASROCK FM2A88M Pro3+ chipset A88X Bolton-D4
      • CPU:
        A10-7800, 4 CPU, 4 thr, 65/45W, FM2+, 28nm, Steamroller/Kaveri
      • Memory:
        10GB (Nanya and kingston ddr3-1333 9-9-9-24)
      • Graphics:
        Radeon R7 720MHz (8 GPU cores, integrated in CPU)
      • Sound Card:
        RealTek ALC662 (integrated in MB)
      • Hard Drives:
        Seagate ST500DM002-1BD142 500GB 7200RPM
      • Power Supply:
        SuperFlower 450W 80+ Platinum (SF-450P14PE)
      • Case:
        Sharkoon VG4-S
      • Cooling:
        Realtek RTL8111GR (NIC integrated in MB)
      • Display:
        Samsung SyncMaster SA100 LS22A100NS-EN
      • Operating System:
        Windows 10 Home/Standard x64

    Re: [Visual C++] Windows Programming Tutorials?

    Yes, Richard, but the windows api didn't change in the meanwhile: always c and Windows api (written in c).
    Then, yes, one can also use c++ and c# to write programs, but then one'll need to provide also their vc++ redistributables and his users will need different versions of .net frameworks and without them one'll start to get errors.
    Some programs written in the old manner still works instead, without .net framework and without redistributables.

    Therefore one'll need to learn c, c++ (mfc, atl, etc), windows api, c#, and maybe one'll give up.
    Whereas when one programs in c with windows api, one'll need only those two; one can always learn c++ (mfc, atl, etc) and c# later (they are still using windows api).
    Last edited by xilolee; 10-09-2016 at 06:58 AM.

  14. #14
    niemiro's Avatar
    Join Date
    Mar 2012
    Location
    District 12
    Posts
    7,868

    Re: [Visual C++] Windows Programming Tutorials?

    Actually the WinAPI has changed over the years. Not nearly as much as the language but it has changed.

    Quote Originally Posted by Wikipedia
    Over the years, various changes and additions were made to Windows systems, and the Windows API changed and grew to reflect this. The Windows API for Windows 1.0 supported fewer than 450 function calls, whereas modern versions of the Windows API support thousands.
    Quote Originally Posted by Wikipedia
    One of the largest changes to the Windows API was the transition from Win16 (shipped in Windows 3.1 and older) to Win32 (Windows NT and Windows 95 and up).
    Quote Originally Posted by Wikipedia
    Almost every new version of Microsoft Windows has introduced its own additions and changes to the Windows API.
    Even a cursory read of Windows API - Wikipedia, the free encyclopedia would have shown you that you are wrong.


    Now look here - a hello world application which is hundreds of lines long. Written in C and an ancient version of WinAPI.

    Petzold Book Blog - The Infamous Windows Hello World Program

    We've moved on since then. As computers have got more and more complex, Microsoft and other API developers have been creating more and more wrappers, functions or language extensions to simplify everyday or routine coding tasks. It is nave and foolish to think that shunning 20 years of computer development and returning to the 1990s is a good way forward.


    My precise point is that - at this early stage - building up from a basis of C and trying to learn ancient techniques, followed by repeatedly re-learning new ones as you progress up through the years, breaking old habits and trying to forget things C programmers did we no longer consider best practice, is an exceptionally bad way to trying to learn to program.

    Instead buy a modern C++ programming book, which teaches the latest and most up to date techniques, and jump straight in there. Don't start 20 years ago and build on a shoddy foundation of C. Go straight to modern C++.


    Your talk about redistributables is also again wrong. Microsoft keep building the latest ones directly into Windows OOBE. Even as far back as Windows Vista - dating from the 2005 era - has .net Framework 2.0 and Visual C++ Redistributable 2005. So you don't even have to bundle anything with your installer to make your programs work.


    Almost every piece of advice you have given here is wrong. Please consider carefully whether or not you have done enough WinAPI programming to talk knowledgeable in this area.

  15. #15
    xilolee's Avatar
    Join Date
    Dec 2013
    Location
    World, Europe, Italy
    Posts
    2,235
    • specs System Specs
      • Manufacturer:
        XILOLEE.com
      • Model Number:
        XILO
      • Motherboard:
        ASROCK FM2A88M Pro3+ chipset A88X Bolton-D4
      • CPU:
        A10-7800, 4 CPU, 4 thr, 65/45W, FM2+, 28nm, Steamroller/Kaveri
      • Memory:
        10GB (Nanya and kingston ddr3-1333 9-9-9-24)
      • Graphics:
        Radeon R7 720MHz (8 GPU cores, integrated in CPU)
      • Sound Card:
        RealTek ALC662 (integrated in MB)
      • Hard Drives:
        Seagate ST500DM002-1BD142 500GB 7200RPM
      • Power Supply:
        SuperFlower 450W 80+ Platinum (SF-450P14PE)
      • Case:
        Sharkoon VG4-S
      • Cooling:
        Realtek RTL8111GR (NIC integrated in MB)
      • Display:
        Samsung SyncMaster SA100 LS22A100NS-EN
      • Operating System:
        Windows 10 Home/Standard x64

    Re: [Visual C++] Windows Programming Tutorials?

    Yes, Richard, I wrote it in my first reply that I'm not a programmer.
    But when I was interested (to search the best programming language to learn), trying to do simple things, I've been lost looking at c, then c++, then mfc (that should have simplified things), then atl, then (can't remember but there is another framework for c++), to then learn there is c# (that should have simplified things), and why not d programming language, and so forth.
    Now (well, some years ago when windows 8 came out) Petzold says it's the turn of c# and XAML (programming windows 6th edition).
    But if one wants to program in windows, he'll discover windows API are needed with all those languages/frameworks. Even when they are a bit hidden in the framework.
    I.e., the point, I tried to reach, is one needs to learn windows api (to learn the current windows api is obviously better, I didn't want to say one should learn outdated windows api - in 5th edition by the way there are for sure outdated api, but I think, not sure, they are not changed too much - i.e., Microsoft still supports old api, otherwise they could have broken every previous windows OS).
    Last edited by xilolee; 10-09-2016 at 06:04 PM.

  16. #16
    AceInfinity's Avatar
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    1,725

    Re: [Visual C++] Windows Programming Tutorials?

    Quote Originally Posted by niemiro View Post
    Actually the WinAPI has changed over the years. Not nearly as much as the language but it has changed.

    Quote Originally Posted by Wikipedia
    Over the years, various changes and additions were made to Windows systems, and the Windows API changed and grew to reflect this. The Windows API for Windows 1.0 supported fewer than 450 function calls, whereas modern versions of the Windows API support thousands.
    Quote Originally Posted by Wikipedia
    One of the largest changes to the Windows API was the transition from Win16 (shipped in Windows 3.1 and older) to Win32 (Windows NT and Windows 95 and up).
    Quote Originally Posted by Wikipedia
    Almost every new version of Microsoft Windows has introduced its own additions and changes to the Windows API.
    Even a cursory read of Windows API - Wikipedia, the free encyclopedia would have shown you that you are wrong.


    Now look here - a hello world application which is hundreds of lines long. Written in C and an ancient version of WinAPI.

    Petzold Book Blog - The Infamous Windows Hello World Program

    We've moved on since then. As computers have got more and more complex, Microsoft and other API developers have been creating more and more wrappers, functions or language extensions to simplify everyday or routine coding tasks. It is nave and foolish to think that shunning 20 years of computer development and returning to the 1990s is a good way forward.


    My precise point is that - at this early stage - building up from a basis of C and trying to learn ancient techniques, followed by repeatedly re-learning new ones as you progress up through the years, breaking old habits and trying to forget things C programmers did we no longer consider best practice, is an exceptionally bad way to trying to learn to program.

    Instead buy a modern C++ programming book, which teaches the latest and most up to date techniques, and jump straight in there. Don't start 20 years ago and build on a shoddy foundation of C. Go straight to modern C++.


    Your talk about redistributables is also again wrong. Microsoft keep building the latest ones directly into Windows OOBE. Even as far back as Windows Vista - dating from the 2005 era - has .net Framework 2.0 and Visual C++ Redistributable 2005. So you don't even have to bundle anything with your installer to make your programs work.


    Almost every piece of advice you have given here is wrong. Please consider carefully whether or not you have done enough WinAPI programming to talk knowledgeable in this area.
    Yes but the basis of the Windows API is still the same. A lot of the same conventions are used in newer parts of the Windows API even years later. IMO, it takes more getting used to what the P, C, L, W, T means in things like PVOID, PCSTR, and such, among other common standards throughout the Windows API than it does getting used to C itself. These things aren't going to change but you still have to know what they mean when dealing with the Windows API in order to fully understand what you're doing, and this isn't going to change anytime soon because things that deviate from the original coding conventions they've used would make it harder for Microsoft to maintain. You can learn all the C in the world but you'll still be reading MSDN article after MSDN article to learn how to use the Windows API properly without doing something bad.

    As for learning the Windows API, any book on C++ is not going to help at all... The Windows API doesn't consist of functions that use templates, smart pointers, vectors, references, etc... He'll want to start off with a basic book on C, then grab a book dedicated to the Windows API itself to learn more about its structure.

    The only thing with learning from older books is that you may run into things like 'void main' and deprecated functions that have been superseded by newer functions and entire API's. The rest of the information if you can get past that is still going to be at least somewhat helpful for getting a foot in the door... But anyone with enough Windows API experience might even be as bold as to say that it's almost like a separate language that you have to learn on the side apart from C, and unless you coincidentally use all the same conventions that Microsoft uses, it's probably still going to look unfamiliar to you even as an experienced C programmer.
    Last edited by AceInfinity; 10-10-2016 at 06:58 PM.
    Automation Programmer
    Microsoft MVP [2012 - 2018]

Similar Threads

  1. [LINK] Programming Tutorials/Books
    By x BlueRobot in forum Programming
    Replies: 2
    Last Post: 07-24-2013, 04:01 AM
  2. Replies: 1
    Last Post: 07-11-2013, 07:25 PM
  3. Testing Windows 8 apps using Visual Studio 2012
    By JMH in forum Microsoft News
    Replies: 0
    Last Post: 08-20-2012, 04:13 PM
  4. Replies: 1
    Last Post: 06-09-2012, 05:45 AM

Log in

Log in