Click here to Skip to main content
15,898,134 members

Comments by Member 10660597 (Top 1 by date)

Member 10660597 22-Sep-15 7:15am View    
I have got the module file name of the application using the below method.

TCHAR pBuf[MAX_PATH];
int bytes = GetModuleFileName(NULL, pBuf, MAX_PATH);

now in this pBuf I have got the path as "C:/Program Files/Sample/Smpl.exe" but i need only the directory path ie. "C:/Program Files/Sample/". For that I have tried several split functions but it did not work.

Is there any possible way to do this.?