Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CloseHandle

CloseHandle

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Peter Liddle
    wrote on last edited by
    #1

    Hey Guys I am using closehandle to close a file handle and it returns FALSE so therefore means its failed but when i do get last error it says operation completed successsfully. Any ideas? Im don't think a later function overwrites the lasterror either since it is only closing a handle. I might be wrong Peter

    L N 2 Replies Last reply
    0
    • P Peter Liddle

      Hey Guys I am using closehandle to close a file handle and it returns FALSE so therefore means its failed but when i do get last error it says operation completed successsfully. Any ideas? Im don't think a later function overwrites the lasterror either since it is only closing a handle. I might be wrong Peter

      L Offline
      L Offline
      Le centriste
      wrote on last edited by
      #2

      Use GetLastError() and FormatMessage(). If you want, just make your code display the result of GetLastError() and use Error Lookup to see the corresponding message. Michel It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
      - TreeBeard

      1 Reply Last reply
      0
      • P Peter Liddle

        Hey Guys I am using closehandle to close a file handle and it returns FALSE so therefore means its failed but when i do get last error it says operation completed successsfully. Any ideas? Im don't think a later function overwrites the lasterror either since it is only closing a handle. I might be wrong Peter

        N Offline
        N Offline
        Nish Nishant
        wrote on last edited by
        #3

        Was it a successfully opened handle? Nish


        Check out last week's Code Project posting stats presentation from :- http://www.busterboy.org/codeproject/ Feel free to make your comments.

        P 1 Reply Last reply
        0
        • N Nish Nishant

          Was it a successfully opened handle? Nish


          Check out last week's Code Project posting stats presentation from :- http://www.busterboy.org/codeproject/ Feel free to make your comments.

          P Offline
          P Offline
          Peter Liddle
          wrote on last edited by
          #4

          Yeah, and i used it to write to a file with no problems. I also formated the message and viewed the last error and it says operation completed successfully Peter

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups