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. Invalid file path error

Invalid file path error

Scheduled Pinned Locked Moved C / C++ / MFC
helpwindows-admintutorialquestion
5 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.
  • M Offline
    M Offline
    masnu
    wrote on last edited by
    #1

    I have made all the necessary registry entries to associate my app with a project file that it creates. When I double click on the file my app starts up but I get an invalid path error when opening the file. Once the application is running, however, I can open the project file without any problems. I am getting the file name from the m_lpCmdLine variable in my CWinApp derived class. Does anyone have any suggestions how to resolve this problem? Thanks.

    D T CPalliniC M 4 Replies Last reply
    0
    • M masnu

      I have made all the necessary registry entries to associate my app with a project file that it creates. When I double click on the file my app starts up but I get an invalid path error when opening the file. Once the application is running, however, I can open the project file without any problems. I am getting the file name from the m_lpCmdLine variable in my CWinApp derived class. Does anyone have any suggestions how to resolve this problem? Thanks.

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

      masnu wrote:

      ...but I get an invalid path error when opening the file.

      Does the path contain spaces?


      "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      1 Reply Last reply
      0
      • M masnu

        I have made all the necessary registry entries to associate my app with a project file that it creates. When I double click on the file my app starts up but I get an invalid path error when opening the file. Once the application is running, however, I can open the project file without any problems. I am getting the file name from the m_lpCmdLine variable in my CWinApp derived class. Does anyone have any suggestions how to resolve this problem? Thanks.

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        why don't you use your debugger for this ? you could check where something is lost. what i suspect is that you have spaces in your file path, and passing it through the commandline will not work since you don't put the path within quotes ("").


        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

        1 Reply Last reply
        0
        • M masnu

          I have made all the necessary registry entries to associate my app with a project file that it creates. When I double click on the file my app starts up but I get an invalid path error when opening the file. Once the application is running, however, I can open the project file without any problems. I am getting the file name from the m_lpCmdLine variable in my CWinApp derived class. Does anyone have any suggestions how to resolve this problem? Thanks.

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          masnu wrote:

          Does anyone have any suggestions how to resolve this problem?

          Yes, some kinda of debugging: for instance printout (maybe with a message box) command line content. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

          In testa che avete, signor di Ceprano?

          1 Reply Last reply
          0
          • M masnu

            I have made all the necessary registry entries to associate my app with a project file that it creates. When I double click on the file my app starts up but I get an invalid path error when opening the file. Once the application is running, however, I can open the project file without any problems. I am getting the file name from the m_lpCmdLine variable in my CWinApp derived class. Does anyone have any suggestions how to resolve this problem? Thanks.

            M Offline
            M Offline
            masnu
            wrote on last edited by
            #5

            I managed to solve the problem. For those who are intrested I did the following: CommandLineInfo cmdInfo; ParseCommandLine( cmdInfo ); CString strProjectName = cmdInfo.m_strFileName; This works without any issues. Thanks.

            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