本文整理汇总了C++中IObjParam::GetDir方法的典型用法代码示例。如果您正苦于以下问题:C++ IObjParam::GetDir方法的具体用法?C++ IObjParam::GetDir怎么用?C++ IObjParam::GetDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObjParam
的用法示例。
在下文中一共展示了IObjParam::GetDir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openMapFile
// Fetch the map file full path name.
HANDLE LocationDialog::openMapFile(char* mapName)
{
HANDLE hMap;
TCHAR fileName[MAX_PATH];
int len;
// Get subdir containing this plugin.
GetModuleFileName(hInstance, fileName, MAX_PATH);
// Append subdir string containing maps.
TCHAR *slash = _tcsrchr(fileName, '\\');
if (slash) {
_tcscpy(slash, SGEOLOC);
} else {
// If the plugin filename contains no path information, look in plugcfg.
_tcscpy(fileName,theInterface->GetDir(APP_PLUGCFG_DIR));
len = _tcslen(fileName);
if (len) {
if (_tcscmp(&fileName[len-1],_T("\\")))
_tcscat(fileName,_T("\\"));
}
}
_tcscat(fileName,mapName);
hMap = CreateFile(fileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (hMap == INVALID_HANDLE_VALUE) {
// If that fails, look in the MaxStart dir.
_tcscpy(fileName,theInterface->GetDir(APP_MAXSTART_DIR));
len = _tcslen(fileName);
if (len) {
if (_tcscmp(&fileName[len-1],_T("\\")))
_tcscat(fileName,_T("\\"));
_tcscat(fileName, GEOLOC);
}
_tcscat(fileName,mapName);
hMap = CreateFile(fileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (hMap == INVALID_HANDLE_VALUE) {
// If THAT fails, look beneath the main exe dir.
_tcscpy(fileName,theInterface->GetDir(APP_MAXROOT_DIR));
len = _tcslen(fileName);
if (len) {
if (_tcscmp(&fileName[len-1],_T("\\")))
_tcscat(fileName,_T("\\"));
}
_tcscat(fileName, GEOLOC);
_tcscat(fileName,mapName);
hMap = CreateFile(fileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (hMap == INVALID_HANDLE_VALUE) {
// Last try: If THAT fails, look IN the main exe dir.
_tcscpy(fileName,theInterface->GetDir(APP_MAXROOT_DIR));
len = _tcslen(fileName);
if (len) {
if (_tcscmp(&fileName[len-1],_T("\\")))
_tcscat(fileName,_T("\\"));
}
_tcscat(fileName,mapName);
hMap = CreateFile(fileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
}
}
}
return hMap;
}