當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。