.GetModuleFileName()
char path[255];
GetModuleFileName(AfxGetInstanceHandle(), path, MAX_PATH-1);
. _getcwd
#include <direct.h>
char path[255];
_getcwd(path,255);
.GetCommandLine
#include "Shlwapi.h"
LPSTR path = ::GetCommandLine();
PathRemoveArgs(path); //Path.RemoveArgs();
PathUnquoteSpaces(path); //Path.UnquoteSpaces();
PathRemoveFileSpec(path); //Path.RemoveFileSpec();
PathAppend(path,"test.ini");
posted on 2007-05-29 11:57
我风 阅读(2766)
评论(0) 编辑 收藏 引用