Logo Search packages:      
Sourcecode: inkscape version File versions

bool RegistryTool::getExeInfo ( Glib::ustring &  fullPath,
Glib::ustring &  path,
Glib::ustring &  exeName 
)

Get the full path, directory, and base file name of this running executable

Definition at line 105 of file registrytool.cpp.

Referenced by Inkscape::Extension::Implementation::Script::resolveInterpreterExecutable(), and setPathInfo().

{

    char buf[MAX_PATH+1];
    if (!GetModuleFileName(NULL, buf, MAX_PATH))
        {
        fprintf(stderr, "Could not fetch executable file name\n");
        return false;
        }
    else
        {
        //printf("Executable file name: '%s'\n", buf);
        }

    fullPath = buf;
    path     = "";
    exeName  = "";
    Glib::ustring::size_type pos = fullPath.rfind('\\');
    if (pos != fullPath.npos)
        {
        path = fullPath.substr(0, pos);
        exeName = fullPath.substr(pos+1);
        }

    return true;
}


Generated by  Doxygen 1.6.0   Back to index