我做了个对话框界面,当执行时想得到exe文件的当前路径。请问如何实现???
解决方案 »
- IDC_DATETIMEPICKER控件的赋值
- 一个CString成员变量被意外清空的BUG
- std::list push_back失败
- 請問用什麼方法可以判斷系統安裝在哪個盤?
- User Breakpoint called form code 0x797f79f 是什么意思?
- 急!!!用TCP进行文件传输
- 小弟想学VC++,谁能推荐几本入门书来!
- c++ 远程注入call 时候游戏直接给关闭了,很简单的一个无参call
- SDK中可以分割窗口马
- 如何添加MFC的Messagemap中没有的消息的处理方法(如WM_HOTKEY)。
- 怎样得到屏幕分辨率?
- 在哪里可以获得免费的工控仪表控件或类,分可以再加。
GetCurrentDirectory:也可以
{
CString csModuleDir;
char szPath[MAX_PATH];
GetModuleFileName(::AfxGetApp()->m_hInstance,szPath,MAX_PATH);
char szDriver[MAX_PATH];
char szDir[MAX_PATH];
char szFile[MAX_PATH];
char szExt[MAX_PATH];
_splitpath(szPath,szDriver,szDir,szFile,szExt);
csModuleDir=szDriver;
csModuleDir=csModuleDir+szDir;
csModuleDir.TrimRight('\\');
csModuleDir+='\\';
return csModuleDir;
}
GetCurrentDirectory:的用法请说详细些,好吗??谢谢!!!!
DWORD nBufferLength, // size, in characters, of directory buffer
LPTSTR lpBuffer // pointer to buffer for current directory
);
Parameters
nBufferLength
Specifies the length, in characters, of the buffer for the current directory string. The buffer length must include room for a terminating null character.
lpBuffer
Pointer to the buffer for the current directory string. This null-terminated string specifies the absolute path to the current directory