本文整理汇总了C++中Library::InitLibrary方法的典型用法代码示例。如果您正苦于以下问题:C++ Library::InitLibrary方法的具体用法?C++ Library::InitLibrary怎么用?C++ Library::InitLibrary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library
的用法示例。
在下文中一共展示了Library::InitLibrary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitApplication
//-----------------------------------------------------------------------------------------------------------------------------------------------------
VOID Application::InitApplication()
{
#if defined(USE_COM)
CoInitialize(NULL);
#endif
SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER) &UnhandledSEHException);
#if defined(DEBUG)
Trace.AddSink(TextStream(new DebugStream()));
#endif
#if defined(LIBRARYAPI_STATIC)
g_pLibrary = new BaseLibrary();
g_pLibrary->OnInit();
#endif
DWORD ModuleCount = 0;
EnumProcessModules(::GetCurrentProcess(), 0, 0, &ModuleCount);
HMODULE* pModules = new HMODULE[ModuleCount];
EnumProcessModules(::GetCurrentProcess(), pModules, ModuleCount, &ModuleCount);
for (SIZE_T i=0; i<ModuleCount; i++)
{
if (!m_HandleToObjectMap.Contains(pModules[i]))
{
Module* pModule = new Module();
pModule->InitModule(pModules[i]);
pModule->GetModuleInformation();
}
}
for (Map<HMODULE,Module*>::Iterator i = m_HandleToObjectMap.Begin(); i != m_HandleToObjectMap.End(); i++)
{
Pair<HMODULE,Module*> P = *i;
if (IsDerivedFrom(P.Second, &Library::RuntimeType))
{
Library* pLib = (Library*)P.Second;
if (!pLib->InitLibrary(this))
throw InvalidOperationException(this, TEXT("A Library failed to Initialize") );
}
P.Second->GetModuleInformation();
}
if (m_ProductCompany.Length() > 0)
{
m_UserSettingsKey = System::RegistryKey::CurrentUser.TryCreateSubkey( String::Format(TEXT("SOFTWARE\\%s\\%s\\"), m_ProductCompany.ConstStr(), m_ProductName.ConstStr() ), KEY_ALL_ACCESS );
m_MachineSettingsKey = System::RegistryKey::LocalMachine.TryCreateSubkey( String::Format(TEXT("SOFTWARE\\%s\\%s\\"), m_ProductCompany.ConstStr(), m_ProductName.ConstStr() ), KEY_ALL_ACCESS );
}
m_UserConfigFile = Path::Basename(m_ImageName) + ".Config";
m_MachineConfigFile = Path::Basename(m_ImageName) + ".Config";
}