这篇教程C++ GetModuleFileNameA函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetModuleFileNameA函数的典型用法代码示例。如果您正苦于以下问题:C++ GetModuleFileNameA函数的具体用法?C++ GetModuleFileNameA怎么用?C++ GetModuleFileNameA使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetModuleFileNameA函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: sizeof//----- InitInstance() ------------------------------------------------------BOOL CNifUtilsSuiteApp::InitInstance(){ // init common controls (since Win95) INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); // init own instance CWinAppEx::InitInstance(); // no interaction with Win7 taskbar EnableTaskbarInteraction(FALSE); // init RichEdit AfxInitRichEdit2(); // initialize configuration CStringA configName; bool hasConfig(false); GetModuleFileNameA(NULL, configName.GetBuffer(MAX_PATH), MAX_PATH); configName.ReleaseBuffer(); configName.Replace(".exe", ".xml"); hasConfig = Configuration::initInstance((const char*) configName); // initialize Havok (HK_MEMORY_USAGE bytes of physics solver buffer) hkMemoryRouter* pMemoryRouter(hkMemoryInitUtil::initDefault(hkMallocAllocator::m_defaultMallocAllocator, hkMemorySystem::FrameInfo(HK_MEMORY_USAGE))); hkBaseSystem::init(pMemoryRouter, errorReport); // initialize material map Configuration* pConfig(Configuration::getInstance()); NifUtlMaterialList::initInstance(pConfig->_pathNifXML, pConfig->_matScanTag, pConfig->_matScanName); // Register the application's document templates. CSingleDocTemplate* pDocTemplate(new CSingleDocTemplate(IDR_MAINFRAME, RUNTIME_CLASS(CNifUtilsSuiteDoc), RUNTIME_CLASS(CNifUtilsSuiteFrame), RUNTIME_CLASS(CFormNifConvertView)) ); if (!pDocTemplate) return FALSE; AddDocTemplate(pDocTemplate); // Parse command line for standard shell commands, DDE, file open CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); if (!ProcessShellCommand(cmdInfo)) return FALSE; // call DragAcceptFiles only if there's a suffix // In an SDI app, this should occur after ProcessShellCommand // The one and only window has been initialized, so show and update it m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->UpdateWindow(); if (!hasConfig) { AfxMessageBox(L"Seems you're running NifUtilsSuite for the first time./nYou're redirected to Settings now."); m_pMainWnd->PostMessage(WM_COMMAND, ID_OPTIONS_EDIT); } return TRUE;}
开发者ID:skyfox69,项目名称:NifUtilsSuite,代码行数:68,
示例2: MyGetProcAddressstatic FARPROC WINAPIMyGetProcAddress(HMODULE hModule, LPCSTR lpProcName) { if (VERBOSITY >= 3) { /* XXX this can cause segmentation faults */ logGetProcAddress(hModule, lpProcName); } if (!NOOP) { char szModule[MAX_PATH]; DWORD dwRet = GetModuleFileNameA(hModule, szModule, sizeof szModule); assert(dwRet); const char *szBaseName = getBaseName(szModule); ModulesMap::const_iterator modIt; modIt = modulesMap.find(szBaseName); if (modIt != modulesMap.end()) { if (VERBOSITY > 1 && VERBOSITY < 3) { logGetProcAddress(hModule, lpProcName); } const Module & module = modIt->second; const FunctionMap & functionMap = module.functionMap; FunctionMap::const_iterator fnIt; if (HIWORD(lpProcName) == 0) { FARPROC proc = GetProcAddress(hModule, lpProcName); if (!proc) { return proc; } for (fnIt = functionMap.begin(); fnIt != functionMap.end(); ++fnIt) { FARPROC pRealProc = GetProcAddress(hModule, fnIt->first); if (proc == pRealProc) { if (VERBOSITY > 0) { debugPrintf("inject: replacing %s!%s/n", szBaseName, lpProcName); } return (FARPROC)fnIt->second; } } debugPrintf("inject: ignoring %[email C++ GetModuleFileNameEx函数代码示例 C++ GetModuleBaseName函数代码示例
|