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


C++ AfxGetAppModuleState函数代码示例

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


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

示例1: 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

示例2: WKCallPluginFunction

int	WINAPI WKCallPluginFunction(long iPluginFunction, WKPluginFunctionStuff* stuff)
{
	AFX_MANAGE_STATE(AfxGetAppModuleState());
	if(iPluginFunction>1){
		return 0;
	}
	if(iPluginFunction==1){
		/*
		if(hDialog!=0){
			if(hDialog!=HWND(1)){
				HWND hTmp=hDialog;
				hDialog=0;
				EndDialog(hTmp,0);
			}
			return 1;
		}
		hDialog=HWND(1);*/
		FORK(ShowMainDialog,stuff?stuff->hMainWKWindow:0)
	}
	if(iPluginFunction==0){
		CRect rDesktopRECT;
		//::GetWindowRect(GetDesktopWindow(),&rDesktopRECT);
		rDesktopRECT.left=rDesktopRECT.top=-20;
		rDesktopRECT.right=rDesktopRECT.bottom=-10;
		HWND wndShotPhase2 = ::CreateWindowEx(WS_EX_TOOLWINDOW|WS_EX_TOPMOST|WS_EX_TRANSPARENT, "Static", "MENU_WND", WS_DISABLED, rDesktopRECT.left, rDesktopRECT.top, rDesktopRECT.Width(), rDesktopRECT.Height(), 0, 0, g_hinstDll, 0);
		CreateRemOnDate(wndShotPhase2,COleDateTime::GetCurrentTime(),1);
		DestroyWindow(wndShotPhase2); 
	}
	return 1;
}
开发者ID:calupator,项目名称:wiredplane-wintools,代码行数:30,代码来源:WKPlugin.cpp

示例3: AfxNetInitModule

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

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

示例4: AFX_MANAGE_STATE

void TestFileFormatInfos::TestFileFormatInfo()
{
	AFX_MANAGE_STATE(AfxGetAppModuleState());
	CDVController* m_pDVController = new CDVController();

	// Get the FormatInfo Interface
	WSCONVERTERLib::IFormatInfoPtr pFInfo;
	m_pDVController->GetConverter()->QueryInterface(WSCONVERTERLib::IID_IFormatInfo, (void**)&pFInfo);

	assertTest(pFInfo != 0);

	CFormatInfoArray formatInfos(pFInfo, true, true);

	assertTest(formatInfos.size() > 0);

	CFormatInfoArray formatInfos1(pFInfo, false, true);

	assertTest(formatInfos1.size() > 0);

	CFormatInfoArray formatInfos2(pFInfo, true, false);

	assertTest(formatInfos2.size() > 0);

	CFormatInfoArray formatInfos3(pFInfo, false, false);

	assertTest(formatInfos3.size() > 0);

	delete m_pDVController;
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:29,代码来源:TestFileFormatInfos.cpp

示例5: defined

void COXFileWatcher::RemoveAllWatches()
{
#if defined (_WINDLL)
#if defined (_AFXDLL)
	AFX_MANAGE_STATE(AfxGetAppModuleState());
#else
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
#endif
#endif

	// Make the class a Thread-Safe Class
	CSingleLock lockObj(&m_crArrayWatchedDirGuard);
	VERIFY(lockObj.Lock());

	StopThread();
	
	if(m_arWatchedDirs.GetSize() == 0) 
		return;
	for(int i=0; i<=m_arWatchedDirs.GetUpperBound(); i++)
	{
		delete m_arWatchedDirs[i];
	}
	m_arWatchedDirs.RemoveAll();

	if(m_pHandles!=NULL)
	{
		delete [] m_pHandles;
		m_pHandles = NULL;
	}
	m_nNumHandles = 0;
}
开发者ID:drupalhunter-team,项目名称:TrackMonitor,代码行数:31,代码来源:OXFileWatcher.cpp

示例6: GetLicenseKey

BOOL GetLicenseKey (LPWSTR pwKey, size_t iLen)
{
#if _TRiAS_VER < 0x0400
	if (0 == g_dwVer4) 
		return GetLicenseKeyObsolete(pwKey, iLen);
#endif // _TRiAS_VER < 0x0400

	AFX_MANAGE_STATE(AfxGetAppModuleState());

VERIFYLICENSE VL;

	INITSTRUCT(VL, VERIFYLICENSE);
	VL.iMode = VERIFYMODE_DontShowDialog;
	VL.lLevelOrOption = CKIOPTION_ATKIS;
	if (!DEX_VerifyLicenseOption(VL))
		return FALSE;

CEsnecilExt Lic;
LPCSTR pcSiteCode = Lic.GetSiteCode();

	if (NULL != pwKey && NULL != pcSiteCode) 		// Key kopieren
		mbstowcs (pwKey, pcSiteCode, min(iLen, strlen(pcSiteCode)));

	return (NULL != pcSiteCode) ? TRUE : FALSE;
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:25,代码来源:LICENZ.CPP

示例7: OutputDebugString

LONG CBenubirdAutoProxy::ConvertToPDF(LPCTSTR files)
{
	OutputDebugString(_T("------------------------------------- convert AutoProxy"));

	AFX_MANAGE_STATE(AfxGetAppModuleState());

	CStringList lFileList;
	CString lFiles = files;
	int lPos;
	CString lFile;

	//a tricky solution: if #part1 is true the #part2 is not executed
	while (((lPos = lFiles.Find(_T("####"))) != -1 /*#Part1*/) || ((lPos = lFiles.GetLength()) /*#Part2*/)) 
	{
		lFile = lFiles.Left(lPos);
		if (!lFile.IsEmpty())
			lFileList.AddTail(lFile);
		lFiles = lFiles.Right(lFiles.GetLength() - lPos - 4);
	}

	CConvertToPDFDlg lConvertToPDFDlg(&lFileList);
	lConvertToPDFDlg.DoModal();

	return 0;
}
开发者ID:cspark777,项目名称:PDFManager,代码行数:25,代码来源:BenubirdAutoProxy.cpp

示例8: AFX_MANAGE_STATE

void DVControllerTests::UserCanSaveWDFTest()
{
	AFX_MANAGE_STATE(AfxGetAppModuleState());

	CMDIFrameWnd* pMainFrame = DYNAMIC_DOWNCAST(CMDIFrameWnd, AfxGetMainWnd());
	CChildFrame *pFrame = DYNAMIC_DOWNCAST( CChildFrame, pMainFrame->MDIGetActive() );
	assertTest( pFrame );

	Workshare::OptionApi::SetBool(L"EnableSaveWdfAsNewDocument", false);
	assertTest( ! GetApp()->GetDVController(pFrame)->GetComparisonDocController().UserCanSaveWDF(docNew)) ;
	Workshare::OptionApi::SetBool(L"EnableSaveWdfAsNewDocument", true);
	assertTest(GetApp()->GetDVController(pFrame)->GetComparisonDocController().UserCanSaveWDF(docNew)) ;

	Workshare::OptionApi::SetBool(L"EnableAttachWdfToOriginal", false);
	assertTest( ! GetApp()->GetDVController(pFrame)->GetComparisonDocController().UserCanSaveWDF(docAttachToOriginal)) ;
	Workshare::OptionApi::SetBool(L"EnableAttachWdfToOriginal", true);
	assertTest(GetApp()->GetDVController(pFrame)->GetComparisonDocController().UserCanSaveWDF(docAttachToOriginal)) ;

	Workshare::OptionApi::SetBool(L"EnableAttachWdfToModified", false);
	assertTest( ! GetApp()->GetDVController(pFrame)->GetComparisonDocController().UserCanSaveWDF(docAttachToModified)) ;
	Workshare::OptionApi::SetBool(L"EnableAttachWdfToModified", true);
	assertTest(GetApp()->GetDVController(pFrame)->GetComparisonDocController().UserCanSaveWDF(docAttachToModified)) ;

	Workshare::OptionApi::SetBool(L"EnableVersionWdfToOriginal", false);
	assertTest( ! GetApp()->GetDVController(pFrame)->GetComparisonDocController().UserCanSaveWDF(docVersionOfOriginal)) ;
	Workshare::OptionApi::SetBool(L"EnableVersionWdfToOriginal", true);
	assertTest(GetApp()->GetDVController(pFrame)->GetComparisonDocController().UserCanSaveWDF(docVersionOfOriginal)) ;

	Workshare::OptionApi::SetBool(L"EnableVersionWdfToModified", false);
	assertTest( ! GetApp()->GetDVController(pFrame)->GetComparisonDocController().UserCanSaveWDF(docVersionOfModified)) ;
	Workshare::OptionApi::SetBool(L"EnableVersionWdfToModified", true);
	assertTest(GetApp()->GetDVController(pFrame)->GetComparisonDocController().UserCanSaveWDF(docVersionOfModified)) ;
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:33,代码来源:DVControllerTests.cpp

示例9: GetParentTabViewContainer

COXTabViewContainer* PASCAL GetParentTabViewContainer(CWnd* pWnd,
													  BOOL bOnlyActive/*=TRUE*/)
{
#if defined (_WINDLL)
#if defined (_AFXDLL)
	AFX_MANAGE_STATE(AfxGetAppModuleState());
#else
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
#endif
#endif

	ASSERT(pWnd!=NULL);
	HWND hWndParent=::GetParent(pWnd->GetSafeHwnd());
	if(hWndParent==NULL)
		return NULL;

	COXTabViewContainer* pContainer=
		(COXTabViewContainer*)CWnd::FromHandlePermanent(hWndParent);
	if(pContainer!=NULL)
	{
		ASSERT(::IsWindow(pContainer->m_hWnd));
		if(::IsWindow(pContainer->m_hWnd))
		{
			if(::GetWindowLongPtr(pContainer->m_hWnd,GWL_USERDATA)==
				ID_TABVIEWCONTAINER_SIGN)
			{
				if(!bOnlyActive || pContainer->IsActivePage(pWnd))
				{
					return pContainer;
				}
			}
		}
	}
	return NULL;
}
开发者ID:leonwang9999,项目名称:testcode,代码行数:35,代码来源:OXTabView.cpp

示例10: AFX_MANAGE_STATE

STDMETHODIMP CProjManListEvents::UpdateTargetTree(BSTR sChangedIdPath, E_UPDATE_MODE eMode)
{
    AFX_MANAGE_STATE (AfxGetAppModuleState ());

    if (m_pListView!=NULL)
    {
        CString strIdPath(sChangedIdPath);

        switch(eMode)
        {
        case eUpdateAll:
            m_pListView->UpdateTreeNode(strIdPath);
            break;
        case eUpdateAttributes:
            m_pListView->UpdateTreeNodeAttributes(strIdPath);
            break;
        case eUpdateDelete:
            m_pListView->DeleteTreeNode(strIdPath);
            break;
        case eUpdateInsert:
            m_pListView->InsertTreeNode(strIdPath);
            break;
        }
    }

    return (S_OK); 
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:27,代码来源:ProjManListEvents.cpp

示例11: AFX_MANAGE_STATE

void TestDVCompareController::TestPerformComparison_DisplayRedlineFailed()
{
	AFX_MANAGE_STATE(AfxGetAppModuleState());

	CMainFrame* const pFrame = DYNAMIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
	CChildFrame* const pChild = DYNAMIC_DOWNCAST(CChildFrame, pFrame ? pFrame->MDIGetActive() : NULL);

	CDVController dvC;
	CMockDVCompareController_TestPerformOrder cc( pChild, &dvC );
	
	cc.m_bIsCommandLineComparison = false;
	cc.SetDisplayRedlineFail();
	assertMessage(FAILED(cc.PerformComparison(false, false, false, false)), _T("Comparison did not complete OK"));
	CString sOrder = cc.GetOrderString();

	CString sExpectedOrder = _T("");
	sExpectedOrder += _T("CreateComparisonProgressDlg,");
	sExpectedOrder += _T("ConvertDocument,");
	sExpectedOrder += _T("Converting original succeeded,");

	sExpectedOrder += _T("ConvertDocument,");
	sExpectedOrder += _T("Converting modified succeeded,");

	sExpectedOrder += _T("CompareDocuments,");

	sExpectedOrder += _T("Displaying in progress,");
	sExpectedOrder += _T("DisplayOriginal,");
    sExpectedOrder += _T("DisplayModified,");
    sExpectedOrder += _T("DisplayRedline,");
    sExpectedOrder += _T("Displaying failed,");

	CString sActualOrder   = cc.GetOrderString();

	assertMessage(sActualOrder.CompareNoCase(sExpectedOrder) == 0, _T("PerformComparison not calling correct functions"));	
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:35,代码来源:TestDVCompareController.cpp

示例12: defined

LRESULT COXComboPickerCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
#if defined (_WINDLL)
#if defined (_AFXDLL)
	AFX_MANAGE_STATE(AfxGetAppModuleState());
#else
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
#endif
#endif

	LRESULT lResult=0;
	
	switch(message)
	{
	case CB_GETDROPPEDSTATE:
		lResult=GetDroppedState();
		break;

	case CB_SHOWDROPDOWN:
		ShowDropDown((BOOL)wParam);
		break;

	default:
		lResult=CComboBox::WindowProc(message,wParam,lParam);
		break;
	}

	return lResult;
}
开发者ID:drupalhunter-team,项目名称:TrackMonitor,代码行数:29,代码来源:OXComboPickerCtrl.cpp

示例13: defined

LRESULT CALLBACK COXLayoutManager::GlobalLayoutManagerProc(HWND hWnd, UINT uMsg, 
														   WPARAM wParam, 
														   LPARAM lParam)
	// --- In  : hWnd : 
	//			 uMsg : 
	//			 wParam : 
	//			 lParam :
	// --- Out : 
	// --- Returns : The result of the message
	// --- Effect : This is the global windows procedure of all the COXScrollTipOwner
	//              objects that have subclasses a window
{
#if defined (_WINDLL)
#if defined (_AFXDLL)
	AFX_MANAGE_STATE(AfxGetAppModuleState());
#else
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
#endif
#endif

	COXLayoutManager* pLayoutManager = NULL;

	VERIFY(m_allLayoutManagers.Lookup(hWnd, pLayoutManager));
	ASSERT_VALID(pLayoutManager);
	return pLayoutManager->LayoutManagerProc(hWnd, uMsg, wParam, lParam);
}
开发者ID:drupalhunter-team,项目名称:TrackMonitor,代码行数:26,代码来源:OXLayoutManager.cpp

示例14: defined

//////////////////
// Window proc-like virtual function which specific COXHookWnd-derived class
// will override to do stuff. Default passes the message to the next hook; 
// the last hook passes the message to the original window.
// You MUST call this at the end of your WindowProc if you want the real
// window to get the message. This is just like CWnd::WindowProc, except that
// a COXHookWnd is not a window.
//
LRESULT COXHookWnd::WindowProc(UINT msg, WPARAM wp, LPARAM lp)
{
#if defined (_WINDLL)
#if defined (_AFXDLL)
	AFX_MANAGE_STATE(AfxGetAppModuleState());
#else
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
#endif
#endif

	ASSERT(m_pOldWndProc);

	if(msg==WM_TIMER)
	{
		if(m_nCheckMouseTimerID==(UINT)wp)
			CheckMousePos();
	}
	else if(!m_bMouseIsOver && msg==WM_MOUSEMOVE)
	{
		CheckMousePos();
	}

	LRESULT lResult=(m_pNext ? m_pNext->WindowProc(msg, wp, lp) :	
		::CallWindowProc(m_pOldWndProc,m_hWndHooked,msg,wp,lp));

	return lResult;
}
开发者ID:drupalhunter-team,项目名称:TrackMonitor,代码行数:35,代码来源:OXHookWnd.cpp

示例15: AFX_MANAGE_STATE

STDMETHODIMP CProjManEventsImpl::UpdateClassTree(SAFEARRAY** parrChangedIdPaths)
{
    AFX_MANAGE_STATE (AfxGetAppModuleState ());

    if (m_pDlg!=NULL)
    {
        m_pDlg->AddMsgString("Update Class Tree:");
        BSTR HUGEP *pbstr;
        BSTR bstr;
        HRESULT hr;
        unsigned long i;

        // Get a pointer to the elements of the array.
        hr = ::SafeArrayAccessData(*parrChangedIdPaths, (void HUGEP**)&pbstr);
        if (FAILED(hr))
        {
            return E_FAIL;
        }
        for (i = 0; i < ((*parrChangedIdPaths)->rgsabound[0]).cElements; i++)
        {
            CString str;
            bstr = pbstr[i];
            str = "  " + (CString)bstr;
            m_pDlg->AddMsgString(str);
        }

        ::SafeArrayUnaccessData(*parrChangedIdPaths);
    }

    ::SafeArrayDestroy(*parrChangedIdPaths);

    return (S_OK);
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:33,代码来源:ProjManEventsImpl.cpp


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