Thread: Compiling issue with the OpenGL tutorial by RoD

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    16
    Quote Originally Posted by Ken Fitlike
    So you no doubt fully appreciate how ultimately futile this is as an approach to learning.
    Fully. Like I said I simply was lazy and wanted to see what the program accomplished before reading about exactly what each part does. I'll try and decipher your message and then go from there. Thanks.

    Edit: I'm sorry, but I didn't understand the vast majority of that second paragraph. I've done the basic tutorials and understood as much as my mind would allow, but I'm still lost. Maybe I should look into a book or something.
    Last edited by Twitchmokey; 06-25-2006 at 07:28 PM. Reason: addition

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Quote Originally Posted by Twitchmokey
    Edit: I'm sorry, but I didn't understand the vast majority of that second paragraph. I've done the basic tutorials and understood as much as my mind would allow, but I'm still lost. Maybe I should look into a book or something.
    The warnings are telling you that the compiler expects a numeric type as parameters but are being given NULL, which it regards as a pointer type. For the first warning, CreateWindowEx expects a DWORD as the first parameter ie it should be a number and NULL isn't intended to be used as a number but as a pointer value; it's either defined as (void*) 0 or 0 (zero) depending on whether you're compiling c or c++ but its use implies a pointer. The warning tells you that NULL is a pointer and not a number; it's asking you why you are trying to bash a square peg into a round hole(even though it will convert NULL to zero if you choose to ignore the warning, which you shouldn't).

    Likewise, the 3rd and 4th parameters of PeekMessage are numerical types, too, and NULL should never be used where a numeric type is intended or expected, so change them to zero, too.
    Quote Originally Posted by Desolation
    NULL is defined as 0.
    Quote Originally Posted by windef.h
    #ifndef NULL
    #ifdef __cplusplus
    #define NULL 0
    #else
    #define NULL ((void *)0)
    #endif
    #endif
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGl & SDL issue
    By Arangol in forum Game Programming
    Replies: 3
    Last Post: 06-18-2006, 09:57 AM
  2. SciTe compiling issue C++
    By tio1225 in forum Tech Board
    Replies: 1
    Last Post: 09-18-2005, 12:56 AM
  3. Tutorial #2 issue
    By Keiyentai in forum C++ Programming
    Replies: 7
    Last Post: 03-21-2005, 02:06 AM
  4. compiling and executing issue with lcc win32
    By GanglyLamb in forum C Programming
    Replies: 10
    Last Post: 12-22-2004, 02:24 PM
  5. OpenGL issue...
    By gcn_zelda in forum Windows Programming
    Replies: 2
    Last Post: 05-02-2004, 10:23 AM