怎样得到当前执行程序的路径?? 我是菜鸟,请详细一点,最好有代码说明。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 DWORD GetCurrentDirectory(DWORD nBufferLength,LPTSTR lpBuffer) char path[1024];GetModuleFileName( NULL, // handle to module path, // file name of module 1024); // size of buffer sPath.ReleaseBuffer (); int nPos; nPos=sPath.ReverseFind ('\\'); sPath=sPath.Left (nPos); CString sPath; GetModuleFileName(NULL,sPath.GetBufferSetLength(MAX_PATH+1),MAX_PATH); sPath.ReleaseBuffer (); int nPos; nPos=sPath.ReverseFind ('\\'); sPath=sPath.Left (nPos); 能不能给个例子。如:CString aa;怎样把当前执行程序的路径付给它。 CString strPath = AfxGetAppName();int nPos = strPath.ReverseFind('\\');strPath.SetAt(nPos, 0x00);CString aa = strPath; 关于多显示器中,获取某个显示器图像的问题 如何判断查询值为空? 如何在另一进程的全屏游戏的表面(directX)上写字 bai小车运行的问题 请问如何用vc更改DNS设置? 这个函数写的有什么问题,尤其是对内存的使用?诚征批评。 请问对话框界面切换后不能显示的问题??? 如何隐藏线程中的沙漏光标? 请大虾指教:组件服务端和客户端怎么联调? 变量的转换. 在线等 在基于对话框的程序中如何获得系统目录/系统盘符,如何取一字符串的前几个字母 在基于对话框的程序中如何copy/cut磁盘文件
GetModuleFileName(
NULL, // handle to module
path, // file name of module
1024); // size of buffer
int nPos;
nPos=sPath.ReverseFind ('\\');
sPath=sPath.Left (nPos);
GetModuleFileName(NULL,sPath.GetBufferSetLength(MAX_PATH+1),MAX_PATH);
sPath.ReleaseBuffer ();
int nPos;
nPos=sPath.ReverseFind ('\\');
sPath=sPath.Left (nPos);
如:
CString aa;
怎样把当前执行程序的路径付给它。
int nPos = strPath.ReverseFind('\\');
strPath.SetAt(nPos, 0x00);CString aa = strPath;