当前位置: 首页>>代码示例>>C++>>正文


C++ CModule::Init方法代码示例

本文整理汇总了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);
}
开发者ID:newobj,项目名称:ffwd,代码行数:57,代码来源:AppSignal.cpp

示例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;
}
开发者ID:TolonUK,项目名称:tolonspellchecklib,代码行数:20,代码来源:tscDLL.cpp

示例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;
开发者ID:demize,项目名称:shroudbnc,代码行数:67,代码来源:Core.cpp


注:本文中的CModule::Init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。