本文整理汇总了C++中CModule::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ CModule::Init方法的具体用法?C++ CModule::Init怎么用?C++ CModule::Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModule
的用法示例。
在下文中一共展示了CModule::Init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnWorkspace
void CAppSignal::OnWorkspace(class CUIWorkspace* pUIWorkspace, const POINT& pt)
{
EnterCriticalSection(&m_csControls);
{
if ( pUIWorkspace == m_pUIWorkspace )
{
POINT ptScreen = { pt.x, pt.y };
ClientToScreen(pUIWorkspace->GetHwnd(), &ptScreen);
HMENU hMenu = CreatePopupMenu();
map<string, CFactory<CModule>::FACTORYSTRUCT*>& mapFactory = CFactory<CModule>::GetFactoryMap();
for ( map<string, CFactory<CModule>::FACTORYSTRUCT*>::iterator iter = mapFactory.begin() ; iter != mapFactory.end() ; ++iter )
{
MODULEFACTORYDATA* pmfd = ((MODULEFACTORYDATA*)iter->second->pvData);
if ( !pmfd ) continue;
AppendMenu(hMenu, MF_STRING, (uint32)iter->second, pmfd->m_sCategory.c_str());
}
uint32 nResult = TrackPopupMenu(hMenu, TPM_RETURNCMD|TPM_LEFTALIGN|TPM_LEFTBUTTON, ptScreen.x, ptScreen.y, 0, GetHwnd(), NULL);
if ( nResult != 0 )
{
CFactory<CModule>::FACTORYSTRUCT* pfs = (CFactory<CModule>::FACTORYSTRUCT*)nResult;
MODULEFACTORYDATA* pmfd = ((MODULEFACTORYDATA*)pfs->pvData);
CUIModule* pUIModule = (CUIModule*)CFactory<CUIWindow>::Create("CUIModule");
CModule* pModule = (CModule*)pfs->fnCreate();
pUIModule->SetModule(pModule);
pModule->SetUIModule(pUIModule);
pUIModule->SetParent(m_pUIWorkspace);
m_pUIWorkspace->AddChild(pUIModule);
MODULEINITSTRUCT mis;
mis.pApp = this;
pModule->Init(mis);
pModule->PostInit();
CUIWindow::CREATESTRUCT cs;
cs.x = pt.x;
cs.y = pt.y;
cs.hWndParent = m_pUIWorkspace->GetHwnd();
cs.pUIHost = pModule;
cs.dict.SetString("title", pmfd->m_sCategory);
pUIModule->Create(cs);
m_listModules.push_back(pModule);
m_listUIModules.push_back(pUIModule);
}
DestroyMenu(hMenu);
}
}
LeaveCriticalSection(&m_csControls);
}
示例2: Error_Internal_NullModulePtr
tsc_result TSC_CALLTYPE
tscInit( TSC_INIT_DATA* pData )
{
tsc_func_init();
CModule* pM = CModule::GetInstance(g_hInstDll);
if (!pM)
return Error_Internal_NullModulePtr();
if (!pData)
return Error_ParamWasNull();
if (pData->cbSize != sizeof(TSC_INIT_DATA))
return Error_StructSizeInvalid();
CInitData d(*pData);
tsc_result r = TSC_E_FAIL;
r = pM->Init(d);
return r;
}
示例3: StartMainLoop
//.........这里部分代码省略.........
SSL_CTX_set_verify(m_SSLContext, SSL_VERIFY_PEER, SSLVerifyCertificate);
}
if (!SSL_CTX_use_certificate_chain_file(m_SSLContext, BuildPathConfig("sbnc.crt"))) {
if (SSLPort != 0) {
Log("Could not load public key (sbnc.crt).");
ERR_print_errors_fp(stdout);
return;
} else {
SSL_CTX_free(m_SSLContext);
m_SSLContext = NULL;
}
} else {
SSL_CTX_set_verify(m_SSLClientContext, SSL_VERIFY_PEER, SSLVerifyCertificate);
}
#endif
if (Port != 0 && m_Listener != NULL && m_Listener->IsValid()) {
Log("Created main listener.");
} else if (Port != 0) {
Log("Could not create listener port");
return;
}
#ifdef HAVE_LIBSSL
if (SSLPort != 0 && m_SSLListener != NULL && m_SSLListener->IsValid()) {
Log("Created ssl listener.");
} else if (SSLPort != 0) {
Log("Could not create ssl listener port");
return;
}
#endif
InitializeAdditionalListeners();
Log("Starting main loop.");
if (ShouldDaemonize) {
#ifndef _WIN32
fprintf(stderr, "Daemonizing... ");
UnlockPidFile();
if (Daemonize()) {
fprintf(stderr, "DONE\n");
} else {
fprintf(stderr, "FAILED\n");
}
WritePidFile();
#endif
}
/* Note: We need to load the modules after using fork() as otherwise tcl cannot be cleanly unloaded */
m_LoadingModules = true;
#ifdef _MSC_VER
LoadModule("bnctcl.dll");
LoadModule("bncidentd.dll");
#else
LoadModule("libbnctcl.la");
#endif
char *Out;
i = 0;