#include <windows.h>
char fullPath[100];
CString strPath;
memset(fullPath,0,100);
GetModuleFileName(AfxGetInstanceHandle(), fullPath,100);这句也可换成 GetModuleFileName(NULL, fullPath,100)
strPath=(CString)fullPath;
int position=strPath.ReverseFind('//'); //反向查找"/"所在的位置
strPath=strPath.Left(position+1);
更多技术文章请参看施昌权的个人网站: http://www.joyvc.cn