CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11

Threaded View

  1. #1
    Join Date
    Mar 2007
    Posts
    20

    Open file wont work, it says wrong path

    I'm testing out how to open files with C++ and I've come across a problem. It seems when I try to open a path that has no spaces in it, it works fine. But when I try to open a path with spaces it has an error message that says could not open file and it spouts the path but it stops short where the space is and doesn't seem to read the link after the space occured. Does anyone know what I'm doing wrong?

    For instance this does not work:
    Code:
    #include <stdafx.h>
    #include <iostream>
    using namespace std;
    #include <fstream>
    
    
    int main()
    {
        system("START C:\\Program Files\\FlashFXP\\FlashFXP.exe");
    }

    This one DOES work:

    Code:
    #include <stdafx.h>
    #include <iostream>
    using namespace std;
    #include <fstream>
    
    
    int main()
    {
        system("START C:\\WINDOWS\\notepad.exe");
    }
    Last edited by wolfcry044; November 13th, 2007 at 10:57 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured