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


C++ AfxGetModuleState函数代码示例

本文整理汇总了C++中AfxGetModuleState函数的典型用法代码示例。如果您正苦于以下问题:C++ AfxGetModuleState函数的具体用法?C++ AfxGetModuleState怎么用?C++ AfxGetModuleState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了AfxGetModuleState函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AfxOleUnlockApp

void AFXAPI AfxOleUnlockApp() {
	AfxGetModuleState()->m_comModule.Unlock();
	AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
	if (AfxOleCanExitApp()) {
		AfxOleOnReleaseAllObjects();
	}
}
开发者ID:sirmax1,项目名称:coin,代码行数:7,代码来源:com-module.cpp

示例2: m_pGeneralClass

CComClass::CComClass(CComGeneralClass *gc)
	:	m_pGeneralClass(gc)
	,	m_pModuleState(AfxGetModuleState())
{
	ZeroStruct(m_iid);
	if (gc) {
		AFX_MODULE_STATE *pMS = AfxGetModuleState();
		if (!pMS->m_typeLib.m_iTypeLib)
			pMS->m_typeLib.Load();
		AfxGetModuleThreadState()->m_classList.push_back(unique_ptr<CComClass>(this));
	}
}
开发者ID:sirmax1,项目名称:coin,代码行数:12,代码来源:com-module.cpp

示例3: AfxCoreInitModule

void AFXAPI AfxCoreInitModule()
{
	ASSERT(AfxGetModuleState() != AfxGetAppModuleState());

	// construct new dynlink library in this context for core resources
	CDynLinkLibrary* pDLL = new CDynLinkLibrary(coreDLL, TRUE);
	ASSERT(pDLL != NULL);
	pDLL->m_factoryList.m_pHead = NULL;

	// borrow resources from language specific DLL if loaded
	AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
	AFX_MODULE_STATE* pAppState = AfxGetAppModuleState();
	if (pModuleState->m_appLangDLL == NULL)
		pModuleState->m_appLangDLL = pAppState->m_appLangDLL;
}
开发者ID:VectorDM,项目名称:VC98,代码行数:15,代码来源:DLLINIT.CPP

示例4: AFX_MANAGE_STATE

HRESULT CTRiASToolBar::InsertButton (
	int iIndex, const TBBUTTON *pBttn, ITRiASUIOwner *pIOwner)
{
	AFX_MANAGE_STATE(AfxGetModuleState());
    ASSERT_VALID(this);
    ASSERT(::IsWindow(m_hWnd));

// jetzt Owner zusammen mit dem ID speichern
	if (!((pBttn -> fsStyle & TBSTYLE_SEP) && 0 == pBttn -> idCommand)) {	// Separators not handled here
	pair<UIOwners::iterator, bool> p = m_Owners.insert (pBttn -> idCommand, pIOwner);

		ASSERT(p.second);
		if (!p.second)
			return ResultFromScode (E_FAIL);
	}

// und zur Toolbar hinzufügen
#if !defined(_USE_SEC_CLASSES)
// wenn dieses der erste Zugriff ist, dann Separator entfernen
	if (m_fHasDummySep) {
		DeleteItem (0);
		m_fHasDummySep = false;
	}

CToolBarCtrl &rTB = GetToolBarCtrl();
HRESULT hr = (rTB.InsertButton (iIndex, const_cast<TBBUTTON *>(pBttn))) ? NOERROR : S_FALSE;
#else
HRESULT hr = m_pMainFrm -> InsertButton (this, iIndex, pBttn, pIOwner);
#endif // _USE_SEC_CLASSES

	if (S_OK == hr && IsWindowVisible())
		m_pMainFrm -> DelayRecalcLayout();

	return hr;
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:35,代码来源:TRiASToolBar.cpp

示例5: _AfxMsgFilterHook

static LRESULT CALLBACK _AfxMsgFilterHook(int code, WPARAM wParam, LPARAM lParam) {
	CWinThread* pThread;
	if (AfxGetModuleState()->m_bDLL || (code < 0 && code != MSGF_DDEMGR) || !(pThread = AfxGetThread()))
		return AfxGetThreadState()->m_hookMsg.CallNext(code, wParam, lParam);
	ASSERT(pThread != NULL);
	return (LRESULT)pThread->ProcessMessageFilter(code, (LPMSG)lParam);
}
开发者ID:sirmax1,项目名称:coin,代码行数:7,代码来源:win-thread.cpp

示例6: AfxGetModuleState

BOOL PASCAL COleObjectFactory::UpdateRegistryAll(BOOL bRegister)
{
	AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
	AfxLockGlobals(CRIT_OBJECTFACTORYLIST);
	for (COleObjectFactory* pFactory = pModuleState->m_factoryList;
		pFactory != NULL; pFactory = pFactory->m_pNextFactory)
	{
		if (!pFactory->UpdateRegistry(bRegister))
		{
			AfxUnlockGlobals(CRIT_OBJECTFACTORYLIST);
			return FALSE;
		}
	}
	AfxUnlockGlobals(CRIT_OBJECTFACTORYLIST);
#ifdef _AFXDLL
	AfxLockGlobals(CRIT_DYNLINKLIST);
	// register extension DLL factories
	for (CDynLinkLibrary* pDLL = pModuleState->m_libraryList; pDLL != NULL;
		pDLL = pDLL->m_pNextDLL)
	{
		for (pFactory = pDLL->m_factoryList;
			pFactory != NULL; pFactory = pFactory->m_pNextFactory)
		{
			if (!pFactory->UpdateRegistry(bRegister))
			{
				AfxUnlockGlobals(CRIT_DYNLINKLIST);
				return FALSE;
			}
		}
	}
	AfxUnlockGlobals(CRIT_DYNLINKLIST);
#endif

	return TRUE;
}
开发者ID:anyue100,项目名称:winscp,代码行数:35,代码来源:olefact.cpp

示例7: RawDllMain

BOOL WINAPI RawDllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID)
{
	UNUSED_ALWAYS(hInstance);
	if (dwReason == DLL_PROCESS_ATTACH)
	{
		// Prevent the MFC DLL from being unloaded prematurely
		LoadLibraryA(MFC42_DLL);

		// make sure we have enough memory to attempt to start (8kb)
		void* pMinHeap = LocalAlloc(NONZEROLPTR, 0x2000);
		if (pMinHeap == NULL)
			return FALSE;   // fail if memory alloc fails
		LocalFree(pMinHeap);

		// save critical data pointers before running the constructors
		AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
		pModuleState->m_pClassInit = pModuleState->m_classList;
		pModuleState->m_pFactoryInit = pModuleState->m_factoryList;
		pModuleState->m_classList.m_pHead = NULL;
		pModuleState->m_factoryList.m_pHead = NULL;
	}
	else if (dwReason == DLL_PROCESS_DETACH)
	{
		// Now it's OK for the MFC  DLL to be unloaded (see LoadLibrary above)
		FreeLibrary(GetModuleHandleA(MFC42_DLL));
	}
	return TRUE;    // ok
}
开发者ID:VectorDM,项目名称:VC98,代码行数:28,代码来源:DLLNET.CPP

示例8: AfxNetInitModule

void AFXAPI AfxNetInitModule()
{
	ASSERT(AfxGetModuleState() != AfxGetAppModuleState());

	CDynLinkLibrary* pDLL = new CDynLinkLibrary(extensionDLL, TRUE);
	ASSERT(pDLL != NULL);
}
开发者ID:VectorDM,项目名称:VC98,代码行数:7,代码来源:DLLNET.CPP

示例9: AfxSetTerminate

AFX_TERM_PROC AFXAPI AfxSetTerminate(AFX_TERM_PROC pfnNew)
{
	AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
	AFX_TERM_PROC pfnOld = pModuleState->m_pfnTerminate;
	pState->m_pfnTerminate = pfnNew;
	return pfnOld;
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:7,代码来源:except.cpp

示例10: AfxTermExtensionModule

void AFXAPI AfxTermExtensionModule(AFX_EXTENSION_MODULE& state, BOOL bAll)
{
	// make sure initialized
	if (!state.bInitialized)
		return;

	// search for CDynLinkLibrary matching state.hModule and delete it
	ASSERT(state.hModule != NULL);
	AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
	AfxLockGlobals(CRIT_DYNLINKLIST);
	for (CDynLinkLibrary* pDLL = pModuleState->m_libraryList; pDLL != NULL; )
	{
		CDynLinkLibrary* pNextDLL = pDLL->m_pNextDLL;
		if (bAll || pDLL->m_hModule == state.hModule)
			delete pDLL;    // will unwire itself
		pDLL = pNextDLL;
	}
	AfxUnlockGlobals(CRIT_DYNLINKLIST);

	// delete any local storage attached to this module
	AfxTermLocalData(state.hModule, TRUE);

	// remove any entries from the CWnd message map cache
	AfxResetMsgCache();
}
开发者ID:VectorDM,项目名称:VC98,代码行数:25,代码来源:DLLINIT.CPP

示例11: AfxGetModuleState

//---------------------------------------------------------------------------
void TFileZillaIntf::SetResourceModule(void * ResourceHandle)
{
  // set afx resource handles, taken from AfxWinInit (mfc/appinit.cpp)
  AFX_MODULE_STATE * ModuleState = AfxGetModuleState();
  ModuleState->m_hCurrentInstanceHandle = static_cast<HINSTANCE>(ResourceHandle);
  ModuleState->m_hCurrentResourceHandle = static_cast<HINSTANCE>(ResourceHandle);
}
开发者ID:kocicjelena,项目名称:Far-NetBox,代码行数:8,代码来源:FileZillaIntf.cpp

示例12: AfxInitExtensionModule

BOOL AFXAPI AfxInitExtensionModule(AFX_EXTENSION_MODULE& state, HMODULE hModule)
{
	// only initialize once
	if (state.bInitialized)
	{
		AfxInitLocalData(hModule);
		return TRUE;
	}
	state.bInitialized = TRUE;

	// save the current HMODULE information for resource loading
	ASSERT(hModule != NULL);
	state.hModule = hModule;
	state.hResource = hModule;

	// save the start of the runtime class list
	AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
	state.pFirstSharedClass = pModuleState->m_classList.GetHead();
	pModuleState->m_classList.m_pHead = pModuleState->m_pClassInit;

#ifndef _AFX_NO_OLE_SUPPORT
	// save the start of the class factory list
	state.pFirstSharedFactory = pModuleState->m_factoryList.GetHead();
	pModuleState->m_factoryList.m_pHead = pModuleState->m_pFactoryInit;
#endif

	return TRUE;
}
开发者ID:VectorDM,项目名称:VC98,代码行数:28,代码来源:DLLINIT.CPP

示例13: AfxOleLockControl

BOOL AFXAPI AfxOleLockControl(REFCLSID clsid)
{
	COleControlLock* pLock = NULL;

	TRY
	{
		pLock = new COleControlLock(clsid);
		if (pLock->m_pClassFactory == NULL)
		{
			delete pLock;
			pLock = NULL;
		}
		else
		{
			AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
			AfxLockGlobals(CRIT_CTLLOCKLIST);
			pModuleState->m_lockList.AddHead(pLock);
			AfxUnlockGlobals(CRIT_CTLLOCKLIST);
		}
	}
	CATCH_ALL (e)
	{
		// Note: DELETE_EXCEPTION(e) not necessary
		pLock = NULL;
	}
	END_CATCH_ALL

	return pLock != NULL;
}
开发者ID:Rupan,项目名称:winscp,代码行数:29,代码来源:occlock.cpp

示例14: m_pUnkOuter

CComObjectRootBase::CComObjectRootBase()
	:	m_pUnkOuter(0)
{
	AFX_MODULE_STATE *pMS = AfxGetModuleState();
	if (!pMS->m_pComClass.get())
		pMS->m_pComClass.reset(new CComClass);
	m_pClass = pMS->m_pComClass.get();
//!!!R	pMS->m_comModule.Lock();
}
开发者ID:sirmax1,项目名称:coin,代码行数:9,代码来源:com-module.cpp

示例15: AFX_MANAGE_STATE

LRESULT CRoboEx::QueryInformation(UINT uQueryID, WPARAM wParam, LPARAM lParam)
{

	AFX_MANAGE_STATE(AfxGetModuleState());
	
	EXT_MSG_STRUCT msg;
	msg.wParam  = wParam;
	msg.lParam  = lParam;
	return AfxGetApp()->m_pMainWnd->SendMessage(WM_QAPI, (WPARAM)uQueryID, (LPARAM)&msg);
}
开发者ID:MXControl,项目名称:Metis,代码行数:10,代码来源:RoboEx.cpp


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