Menu

Help with #define STRICT and a pragma comment

2003-01-28
2012-09-26
  • Nobody/Anonymous

    Can anyone give me a hand here?
    Im trying to understand what would be the effect of the lines
    #define STRICT
    #pragma comment(lib,"comctl32.lib")

    at main.c on a C+WinAPI program

    I now what #define is for, but ive never seen this 'STRICT'.

     
    • Nobody/Anonymous

      There was another thread a couple of days ago on pragma comment, in the context that it is used (as Zero pointed out to me), it really doesn't do anything, as that syntax is a Microsoft extension.

      I am sure someone will hop in on strict...

      Wayne

       
    • Nobody/Anonymous

      STRICT turns on additional safeguards in windows header files against 'wrong' typecasting. For example with this on you can assign HWND to HINSTANCE because they're both int internally and you won't see any error.
      With STRICT you'll get an error message.

      Bedeox

       
      • Nobody/Anonymous

        Cool, thanks for the help!

         
    • Nobody/Anonymous

      Strict hasn't been hijacked to nefarious purposes by Msoft then, Bedeox?

      Wayne

       
    • Nobody/Anonymous

      So how did my post end up in front of Bedeox?

      Weird!

      My question still stands though...

      Wayne

       
    • Nobody/Anonymous

      It just changes definitions of some types...
      (Oh, "can't" turned into "'can", what a mistake!)

      This isn't M$ extension, but a feature of win32 headers.
      It does hardly anything to properly written code.

      Bedeox

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.