Get functions of the current program running path

xiaoxiao2021-03-06  25

CString ctest1dlg :: getRunning (void)

{

Char exec (MAX_PATH];

GetModuleFileName (NULL, EXEPATH, MAX_PATH); // A array represents the EXE file path

CString DIR;

Dir.Format ("% s", execPath); // string represents the EXE file path

DIR = Dir.Left (Dir.reverseFind ('//')); // Delete the EXE file name

Return Dir;

}

Return value example

D: / pro / ex1 / debug

[No '/' after the directory]

转载请注明原文地址:https://www.9cbs.com/read-65523.html

New Post(0)