//獲取當前目錄
CString GetModuleDir()
{
CString sPath;
GetModuleFileName(NULL,sPath.GetBufferSetLength(MAX_PATH+1),MAX_PATH);
sPath.ReleaseBuffer();
int nPos=0;
nPos=sPath.ReverseFind('\\');
sPath=sPath.Left (nPos);
CString file;
file.Format("當前路徑:%s",sPath);
AfxMessageBox(file);
return file;
}