Abort Procedure

This is a discussion on Abort Procedure within the Windows Programming forums, part of the Platform Specific Boards category; Code: BOOL CALLBACK AbortProc (HDC hdcPrn, int iCode) { MSG msg ; while (!bUserAbort && PeekMessage (&msg, NULL, 0, 0, ...

  1. #1
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427

    Abort Procedure

    Code:
    BOOL CALLBACK AbortProc (HDC hdcPrn, int iCode)
    {
         MSG msg ;
         
         while (!bUserAbort && PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
         {
              if (!hDlgPrint || !IsDialogMessage (hDlgPrint, &msg))
              {
                   TranslateMessage (&msg) ;
                   DispatchMessage (&msg) ;
              }
         }
         return !bUserAbort ;
    }

    I don't really understand this procedure, this is where I am having the problem.



    if (!hDlgPrint || !IsDialogMessage (hDlgPrint, &msg))
    {
    TranslateMessage (&msg) ;
    DispatchMessage (&msg) ;
    }



    I mean this negation Operator is confusing me, it says if the Dialog Window Handle is not true, meaning that it's true or..........I am not sure please explain. Thanks in advance.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,668
    Conditional expressions are boolean expressions, meaning they evaluate to type bool.
    When you evaluate a scalar type in the context of a boolean expression, anything that is not zero is true, and zero is false.

    So "!hDlgPrint" is the same as "hDlgPrint != 0".

    gg

  3. #3
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427

    When you evaluate a scalar type in the context of a boolean expression, anything that is not zero is true, and zero is false.

    I did not know that. Thanks.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  4. #4
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    What do you exactly mean by a scalar type?
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  5. #5
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,668
    Number.

    gg

  6. #6
    Semi n00b Mithoric's Avatar
    Join Date
    Jun 2003
    Posts
    293
    Scalar quantities have only a size.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. abort() causes a segfault
    By JFonseka in forum C Programming
    Replies: 12
    Last Post: 04-16-2008, 01:40 AM
  2. abort()
    By swgh in forum C++ Programming
    Replies: 5
    Last Post: 02-22-2008, 03:11 AM
  3. Replies: 9
    Last Post: 02-13-2008, 01:59 PM
  4. Procedure
    By Brandy22 in forum C Programming
    Replies: 6
    Last Post: 11-01-2005, 03:52 PM
  5. Collision with quads?
    By SyntaxBubble in forum Game Programming
    Replies: 6
    Last Post: 01-18-2002, 05:17 PM

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