Thread: Windows - how to get started... examples don't help

  1. #1
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,834

    Windows - how to get started... examples don't help

    I'm a complete novice when it comes to "windows" programming - that is, programs that generate a window on the screen. So maybe I'm even using the terminology wrong. I'm not programming windows... I am just programming and wanting to display windows.

    What I want to do is display a status - such as perhaps a fuel gauge (percentage work completed), or error messages. I am crunching huge multi-gigabyte files. That's pretty much it for now. I'll worry about having a nice interface for the user to enter in things later.

    I have chosen simple console (.exe) model. (maybe that's the problem). And I would prefer to continue coding using straight "C". Not C++.

    If I copy (cut-and-paste) examples given online, I just know they won't compile right away. Just by looking at them. Sure I can include the header "windows.h" and any others they might suggest. But still I humor them... and I've spent hours and hours... but of course, inevitably, the compiler gives me a whole lot of undefined this and unresolved that. But of course. I knew it.

    So what's the secret? Do I have to create a different sort of "Project" in the first place? Is there some hidden check-box I have to turn on? Needless to say I'm super frustrated.

    I'm certain I can grasp the concepts once I get something simple working for me. But as long as the compiler refuses, and rightly so given the illegal syntaxes and undefined functions the examples always tell me to use, I am going nowhere fast.

    I'm using Microsoft Visual Studio 2005 / C++
    Last edited by nonoob; 09-24-2008 at 09:05 PM.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    The windows.h is just a header file -- the implementation is in the libraries. I don't remember what they all are. And yes, there's a special project type -- if you set up a new project, you don't want command line, but the windows one and the libraries are automagically set up to be linked in.

    Edit: Oh, if you look up the function name on MSDN, the page will tell you at the bottom what library it's in.

  3. #3
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,834
    I'll give it a shot tomorrow. Thanks so far.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    And I would prefer to continue coding using straight "C". Not C++.
    There is absolutely NOTHING in the Standard Windows API that _REQUIRES_ the use of C++. In fact, nearly all of the kernel code is written in C rather than C++.

    Even more recent interfaces such as Direct3D doesn't use C++ as the interface (and I doubt that any of the Direct3D code is written in C++ either).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,834
    That sounds encouraging. I'm "old school", at home with rolling my own line rasterization, polygon fills, low-level color register manipulations, my own fonts, etc. But when I approach all them thar newfangled OOPS I get a major brain freeze.

  6. #6
    Registered User Swarvy's Avatar
    Join Date
    Apr 2008
    Location
    United Kingdom
    Posts
    195
    Get started with a simple game or something, thats how i got started with windows programming. My advise to you is to get programming, and just try stuff out. thats what i did, and its working a treat. ive learnt so much stuff about windows programming, in such a short time its unbelievable. lol. If you want to get involved in windows programming, I would strongly suggest that u read 1/2 tutorials and then just do loads and loads of coding. There really is nothing like direct programming experience that u get from coding. u can read as many tutorials as u like, but there is no substitute for just having a go urself

    edit: although its not essential, if ur doing more C++ than C, learn classes, simply cos they are awsum (in my opinion), lol. I think they are the best thing ever, lol.
    Last edited by Swarvy; 09-25-2008 at 08:13 PM.

  7. #7
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    You need to create a new WIN32 solution.

    In MSVC 2003 the correct one is under;

    Visual C++
    WIN32
    WIN32 Project

    Even though it is 'Visual C++' (.cpp files) there is nothing non C in the code.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Script errors - bool unrecognized and struct issues
    By ulillillia in forum Windows Programming
    Replies: 10
    Last Post: 12-18-2006, 04:44 AM
  2. Menu Item Caption - /a for right aligned Accelerator?
    By JasonD in forum Windows Programming
    Replies: 6
    Last Post: 06-25-2003, 11:14 AM
  3. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM
  4. Getting Started On Linux
    By shtarker in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 02-15-2002, 08:13 PM