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. CreateFile fails to open temp file

CreateFile fails to open temp file

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
7 Posts 4 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.
  • K Offline
    K Offline
    Kharfax
    wrote on last edited by
    #1

    Hi I have a program asociated with a file extension, when I open the file via Outlook, it creates a temp file in: Documents and Settings/sebastian/Local Settings/Temporary Internet Files/OLK37/file.mio My app receives the path, but CreateFile fails with error 123: File not exist The file exist, but that is a system/hidden folder. Why is failing to open the file?? This is my call to create file: HANDLE hFile = CreateFile(param, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); Thanks in advance :D

    J D R K 4 Replies Last reply
    0
    • K Kharfax

      Hi I have a program asociated with a file extension, when I open the file via Outlook, it creates a temp file in: Documents and Settings/sebastian/Local Settings/Temporary Internet Files/OLK37/file.mio My app receives the path, but CreateFile fails with error 123: File not exist The file exist, but that is a system/hidden folder. Why is failing to open the file?? This is my call to create file: HANDLE hFile = CreateFile(param, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); Thanks in advance :D

      J Offline
      J Offline
      James R Twine
      wrote on last edited by
      #2

      Error 123 is not a File Not Found error - there is something wrong with the path you are passing to CreateFile(...).    Peace!

      -=- James
      Please rate this message - let me know if I helped or not! * * * If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
      Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
      See DeleteFXPFiles

      1 Reply Last reply
      0
      • K Kharfax

        Hi I have a program asociated with a file extension, when I open the file via Outlook, it creates a temp file in: Documents and Settings/sebastian/Local Settings/Temporary Internet Files/OLK37/file.mio My app receives the path, but CreateFile fails with error 123: File not exist The file exist, but that is a system/hidden folder. Why is failing to open the file?? This is my call to create file: HANDLE hFile = CreateFile(param, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); Thanks in advance :D

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Kharfax wrote:

        ...but CreateFile fails with error 123: File not exist

        Error 123 is ERROR_INVALID_NAME.


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "Judge not by the eye but by the heart." - Native American Proverb

        1 Reply Last reply
        0
        • K Kharfax

          Hi I have a program asociated with a file extension, when I open the file via Outlook, it creates a temp file in: Documents and Settings/sebastian/Local Settings/Temporary Internet Files/OLK37/file.mio My app receives the path, but CreateFile fails with error 123: File not exist The file exist, but that is a system/hidden folder. Why is failing to open the file?? This is my call to create file: HANDLE hFile = CreateFile(param, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); Thanks in advance :D

          R Offline
          R Offline
          Rage
          wrote on last edited by
          #4

          Kharfax wrote:

          Documents and Settings/sebastian/Local Settings/Temporary Internet Files/OLK37/file.mio

          Try and open a cmd console to check if the path is really correct. Sometimes folders have another name as the one displayed. Can you open the file with Notepad at the given location ?

          1 Reply Last reply
          0
          • K Kharfax

            Hi I have a program asociated with a file extension, when I open the file via Outlook, it creates a temp file in: Documents and Settings/sebastian/Local Settings/Temporary Internet Files/OLK37/file.mio My app receives the path, but CreateFile fails with error 123: File not exist The file exist, but that is a system/hidden folder. Why is failing to open the file?? This is my call to create file: HANDLE hFile = CreateFile(param, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); Thanks in advance :D

            K Offline
            K Offline
            Kharfax
            wrote on last edited by
            #5

            OK, I did this, I called shellexecute with notepad, and the file openned. ShellExecute(NULL, "open", "notepad.exe", param, NULL,SW_SHOW); So, I dont know :( Help please :D

            J 1 Reply Last reply
            0
            • K Kharfax

              OK, I did this, I called shellexecute with notepad, and the file openned. ShellExecute(NULL, "open", "notepad.exe", param, NULL,SW_SHOW); So, I dont know :( Help please :D

              J Offline
              J Offline
              James R Twine
              wrote on last edited by
              #6

              We need to see what the path looks like in param.    Peace!

              -=- James
              Please rate this message - let me know if I helped or not! * * * If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
              Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
              See DeleteFXPFiles

              K 1 Reply Last reply
              0
              • J James R Twine

                We need to see what the path looks like in param.    Peace!

                -=- James
                Please rate this message - let me know if I helped or not! * * * If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
                Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
                See DeleteFXPFiles

                K Offline
                K Offline
                Kharfax
                wrote on last edited by
                #7

                Solved Damn!, the path had " at the beginning and in the end, I trimed the " and now is working fine Thanks a lot for the help :D

                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