Help learning, recommendations please.

This is a discussion on Help learning, recommendations please. within the Windows Programming forums, part of the Platform Specific Boards category; Hey, well I picked up Charles Petzold's book on windows programming as i've heard lots of good stuff about it. ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    178

    Help learning, recommendations please.

    Hey, well I picked up Charles Petzold's book on windows programming as i've heard lots of good stuff about it. Well I have a decent background in c++ and none at all really in c. This book is based on c, plus the topics are a little complicated. I'm still trying to comprehend the whole, making a window thing. I was just wondering if anyone might have any tips that could help me get moving along. Thanks in advance.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Keep trying. You'll succeed.

    Kuphryn

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    >>> This book is based on c,

    You can program the API in just about anything, don't worry about that, the stuff in the book will compile with a C++ compiler.

    Do you have any specific problem?
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    Registered User
    Join Date
    May 2002
    Posts
    178
    Yeah actually i'm having a few specific problems, the main one i'm concerned with now is (this is copied exactly from petzold's book)

    #define NUMLINES((int)(sizeof devcaps / sizeof devcaps[0]))

    gives me these error messages

    \\sndc1\users\jwallace\progra~1\api\devcaps1.c:5: warning: invalid character in macro parameter name

    \\sndc1\users\jwallace\progra~1\api\devcaps1.c:5: badly punctuated parameter list in `#define'

    any help would be appreciated. I really want to get into this and learn it but dev-cpp is not making it very easy. I do this from work so i can't install my cpp.net here ) :
    Oi Oi Oi!!!!

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    its missing the braces
    try
    Code:
    #define      NUMLINES          ((int)(sizeof(devcaps) / sizeof(devcaps[0])))
    "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

  6. #6
    Registered User
    Join Date
    May 2002
    Posts
    178
    Now if i put it as

    Code:
    #define     NUMLINES     ((int)(sizeof(devcaps) / sizeof(devcaps[0])))
    I get the error message that refers back to winbase.h line 938 saying prototype declaration but if i do
    Code:
    #define NUMLINES((int)(sizeof(devcaps) / sizeof(devcaps[0])))
    I get the same error message as before
    Oi Oi Oi!!!!

  7. #7
    Registered User
    Join Date
    Apr 2002
    Posts
    12
    Here are the source that works for me...

    #define NUMLINES ((int) (sizeof sysmetrics / sizeof sysmetrics [0]))

    I use Dev-C++ 4

    it works for me!!
    btw rember that the #include <windows.h> shut be before #include <sysmets.h>

    thats all I know about that
    I'm a newbie, so don't take my words for facks!
    btw, I'm useing Dev-4

  8. #8
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    I added the line to my current project and it compiles fine with VC++ 6.0.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  9. #9
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    >>I get the error message that refers back to winbase.h line 938 saying prototype declaration but if i do

    My winbase.h has a blank line at 938. (Came with MSVC 6 enterprise )

    Works in mine. Try opening up the winbase.h and looking to see what is conflicting.

    (have you included stddef.h?)
    "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. Machine Learning with Lego Mindstorms
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 01-30-2009, 01:34 PM
  2. Best Approach for Learning
    By UCnLA in forum C Programming
    Replies: 5
    Last Post: 03-21-2008, 02:35 AM
  3. Need Help On a Simple Bank Program
    By oobootsy1 in forum C# Programming
    Replies: 9
    Last Post: 08-08-2005, 10:51 AM
  4. Learning Rate Of C++
    By Krak in forum C++ Programming
    Replies: 27
    Last Post: 01-29-2003, 12:53 PM
  5. API learning reference (for those who are learning)
    By steve_i83 in forum Windows Programming
    Replies: 1
    Last Post: 11-04-2001, 12:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21