How to get Application path, and how to get the path's directory, file name, and type info (how to get the path to run the

zhaozj2021-02-12  132

*********************************************************** ****************** /

/ * * /

/ * Function name: getAppdir * /

/ * Description: Get Application Directory. * /

/ * * /

/ ************************************************** ****************** /

Void getAppdir (CSTRING & Strappdir)

{

Tchar SzfullPath [MAX_PATH];

Tchar Szdir [_MAX_DIR];

Tchar szdrive [_max_drive];

// Get Application's Full Path.::GetModuleFileName (Null, SzfullPath, Max_Path);

// Break Full Path INTO SEPERATE Components._splitpath (SzfullPath, Szdrive, Szdir, Null, NULL);

// store application's drive and pathstrappdir.format (_t ("% s% s"), szdrive, szdir;}

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

New Post(0)