Thread: GetLastError function clarification

  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    347

    GetLastError function clarification

    Hi all,

    In one of the sample programs i have seen the function GetLastError(). My questions are does this function used only when you are writing code in threads? Secondly how useful this function means does it help me in debugging?

    thanks and regards,
    satya

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > My questions are does this function used only when you are writing code in threads?
    No, you use it all the time.

    > Secondly how useful this function means does it help me in debugging?
    Every function that can return an error needs some kind of error handling.
    At the very least, you could log all errors to a log file for later inspection.

    At some point, you'll need to tell the user that the program isn't working as expected.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GetLastError()
    By Chandana in forum C++ Programming
    Replies: 1
    Last Post: 01-26-2010, 03:28 PM
  2. RegisterClassExA getLastError of 87 ?
    By vmars316 in forum Windows Programming
    Replies: 5
    Last Post: 01-23-2010, 09:29 PM
  3. CreateWindowEx - GetLastError() = 6
    By cboard_member in forum Windows Programming
    Replies: 9
    Last Post: 04-20-2006, 08:29 AM
  4. A clarification of my print function query
    By clinamen in forum C++ Programming
    Replies: 1
    Last Post: 03-10-2003, 12:21 PM
  5. Clarification of Function Templates
    By biosx in forum C++ Programming
    Replies: 2
    Last Post: 02-20-2002, 11:42 AM