spawn_async_with_pipes with error code 2



Hi everyone,

I created a program for windows that use a spawn_async_with_pipes  and compiled successfully.
But in runtime when execute the function it gives me an error number "2". In the list of SpawnError the number two is for CHDIR.
What I'm doing wrong?

    typedef std::vector<std::string> strv_t;

    strv_t vector (5);
    vector[0] = "\"c:/mplayer/mplayer.exe\"";
    vector[1] = "\"-quiet\"";
    vector[2] = "\"-slave\"";
    vector[3] = "\"-idle\"";
    vector[4] = "\"c:/mplayer/truthhappens.ogg\"";

    try
    {
        Glib::spawn_async_with_pipes("\"c:/\"", vector, Glib::SpawnFlags(0), sigc::slot<void>(), &_pid, &_stdin, &_stdout, &_stderr);
    }
    catch (Glib::SpawnError e)
    {
        printf("Can't Spawn!!! spawn returns: %d\n", e.code());
        std::cout << "something went wrong!" << std::endl;
        system("sleep 10");
    }

The error:

Can't Spawn!!! spawn returns: 2
something went wrong!

Thanks in advance...
Paulo Flabiano Smorigo


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]