获取应用程序的路径方法

void CTest2009318Dlg::OnGetPath()
{
 CString str;
 str=GetAppPath();
 MessageBox(str); 
 
}
CString CTest2009318Dlg::GetAppPath()
{
 CString str;
 GetModuleFileName(0,str.GetBuffer(MAX_PATH),MAX_PATH);
 return str; 
}

posted @ 2009-03-18 12:51  绿人  阅读(1200)  评论(0)    收藏  举报