这篇教程C++ AfxGetStaticModuleState函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AfxGetStaticModuleState函数的典型用法代码示例。如果您正苦于以下问题:C++ AfxGetStaticModuleState函数的具体用法?C++ AfxGetStaticModuleState怎么用?C++ AfxGetStaticModuleState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AfxGetStaticModuleState函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AFX_MANAGE_STATE/** * Function name CDialogGenBase::GetAlias * Description returns the alias for the st object * @return CString * @exception - * @see -*/CString CDialogGenBase::GetAlias(){ AFX_MANAGE_STATE(AfxGetStaticModuleState( )); return m_ObjPropGenBase.m_Alias;}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:12,
示例2: DllCanUnloadNowSTDAPI DllCanUnloadNow(void){ AFX_MANAGE_STATE(AfxGetStaticModuleState()); return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;}
开发者ID:opensim4opencog,项目名称:PrologVirtualWorlds,代码行数:5,
示例3: AFX_MANAGE_STATE/** * Function name SysComment::GetRange * Description returns the range of the system comment * @return const StringPosRange& * @exception - * @see -*/const StringPosRange& SysComment::GetRange() const{ AFX_MANAGE_STATE(AfxGetStaticModuleState( )); return m_range;}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:13,
示例4: DesertFinitNoGuiDLL_DECL void *DesertFinitNoGui(bool noError,bool noGui,const char *applyConstraints){ AFX_MANAGE_STATE(AfxGetStaticModuleState()); ASSERT_EX( CManager::theInstance, "CoreInit", "CManager::theInstance IS null"); CCSetErrDialog cse_dialog; if(!CManager::theInstance->VerifyConstraints(&cse_dialog)) { delete CManager::theInstance; CManager::theInstance = NULL; throw new CDesertException(cse_dialog.m_strErrCts); } CManager::theInstance->AnalyseConstraints(); CManager::theInstance->GenerateNextHierarchy(); void * retval = NULL; if (noError) { if (CManager::theInstance->HasConstraints()) { if (applyConstraints) { CStringList cNames; bool applyAll = strncmp(applyConstraints, "applyAll", 8) == 0; if (!applyAll) { char *cons = strdup(applyConstraints); char *cName = strtok( cons, ":" ); while(cName) { cNames.AddTail( cName ); cName = strtok( NULL, ":" ); } } CDynConstraintSet *set = new CDynConstraintSet(0); set->RemoveAll(); CDynConstraintSetList & setlist = CManager::theInstance->GetConstraintSets(); POSITION sl_pos = setlist.GetHeadPosition(); while (sl_pos) { CDynConstraintSet * setlist_i = setlist.GetNext(sl_pos); CDynConstraintList& list = setlist_i->GetConstraints(); POSITION pos1 = list.GetHeadPosition(); while(pos1) { CDynConstraint *cur = list.GetNext(pos1); const CString& nm = cur->GetName(); if (applyAll || cNames.Find(nm)) { Info("DesertFinit", "Applying Constraint: %s", nm); cur->SetApplied(); set->InsertConstraint(cur); } } } // prune & generate next hierarchy double dspSize; long repSize; long clockTime; try{ CManager::theInstance->GetSizeInfo(dspSize, repSize, clockTime, set); }catch(CDesertException *e) { CManager::theInstance->GenerateNextHierarchy(); set->RemoveAll(); delete set; delete CManager::theInstance; CManager::theInstance = NULL; StopLogging(); throw e; } CManager::theInstance->GenerateNextHierarchy(); Info("DesertFinit", "Design Space Size Info: %f %d %d", dspSize, repSize, clockTime); set->RemoveAll(); delete set; } }// CManager::theInstance->//#ifdef DO_STORE_CONFIGURATIONS // dump the configurations CString fname = projectName + ".cfg"; std::string errmsg; try{ retval = CManager::theInstance->StoreConfigurations(fname, errmsg); } catch(CDesertException *e) { delete CManager::theInstance; CManager::theInstance = NULL; StopLogging(); throw e; }//#endif }//.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:metamorphosys-desktop,代码行数:101,
示例5: DllGetClassObjectSTDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv){ AFX_MANAGE_STATE(AfxGetStaticModuleState()); return AfxDllGetClassObject(rclsid, riid, ppv);}
开发者ID:NickSerg,项目名称:PDFLibNet,代码行数:5,
示例6: AFX_MANAGE_STATEHRESULT CCommands::XApplicationEvents::DocumentSave (IDispatch * theDocument){ AFX_MANAGE_STATE (AfxGetStaticModuleState ()); return S_OK;}
开发者ID:coliveira,项目名称:vim,代码行数:5,
示例7: AFX_MANAGE_STATECMarkReaderWriter::CMarkReaderWriter(){ AFX_MANAGE_STATE(AfxGetStaticModuleState()); m_aAllMarks.SetSize(0, 160);}
开发者ID:identity0815,项目名称:os45,代码行数:6,
示例8: AFX_MANAGE_STATE/** * Function name Resource::getTarget * Description returns the target for the resource * @return const string& * @exception - * @see -*/const string& Resource::getTarget() const{ AFX_MANAGE_STATE(AfxGetStaticModuleState( )); return m_target;}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:13,
示例9: StartEnliverBOOL WINAPI StartEnliver(){ AFX_MANAGE_STATE(AfxGetStaticModuleState()); return StartEnliverRaw(TRUE);}
开发者ID:calupator,项目名称:wiredplane-wintools,代码行数:5,
示例10: AFX_MANAGE_STATESTDMETHODIMP CPointClass::get_LastErrorCode(long *pVal){ AFX_MANAGE_STATE(AfxGetStaticModuleState()) *pVal = tkNO_ERROR; return S_OK;}
开发者ID:liuzhumei,项目名称:MapWinGIS,代码行数:6,
示例11: AFX_MANAGE_STATEBOOL CPolyTool::OnLButtonDown( UINT nFlags, POINT ptScreen ){ AFX_MANAGE_STATE(AfxGetStaticModuleState( )); HRESULT hr = S_OK; BOOL bHandled = FALSE; VARIANT_BOOL bSafe = VARIANT_TRUE; HWND hWnd; VARIANTARG varHitParams,varHitResult; BOOL bMakeNewBoundary = TRUE; D3DVECTOR vec; ::VariantInit( &varHitParams ); ::VariantInit( &varHitResult ); float flX = (float)ptScreen.x; float flY = (float)ptScreen.y; float flZ = 0.0; if(!m_pUIView || !m_pControlManager) { hr = VWSTUDIO_E_BADCONTROLINITIALIZATION; goto EXIT_FAIL; } if (!m_piEditorViewControl) { hr = m_pUIView->QueryInterface(DIID__RenderingControl, (LPVOID*) &m_piEditorViewControl); if (FAILED(hr) || (m_piEditorViewControl == NULL)) goto EXIT_FAIL; } hr = m_pUIView->DeviceToWorld( &flX, &flY, &flZ); if(FAILED(hr)) goto EXIT_FAIL; m_pUIView->get_HWND(&hWnd); ::SetFocus(hWnd); //TRACE("CPolyTool::OnLButtonDown point.x = %d, y = %d, World.x = %7.2f, z = %7.2f/n", ptScreen.x, ptScreen.y, flX, flZ); // Get selected BoundaryList. Create a new an Boundary, because this is the first point of a new one. if(NULL == m_pBoundary) { varHitParams.vt = VT_POINT_BYREF; varHitParams.byref = (LPVOID) &ptScreen; hr = ((IVWUIView*)m_pUIView)->HitTest(varHitParams, 0, &varHitResult); if( FAILED(hr)) goto EXIT_FAIL; //Attempt a vertex insertion if we clicked on one. if(varHitResult.vt != VT_EMPTY) { int nPickResult; nPickResult = TryInsVert(&varHitResult, ptScreen.x, ptScreen.y); if (nPickResult == PICKRESULT_POINTUNSAFE || nPickResult == PICKRESULT_INSERTOK || nPickResult == PICKRESULT_PERMISSION_DENIED) { if (nPickResult != PICKRESULT_INSERTOK) MessageBeep(MB_ICONASTERISK); bMakeNewBoundary = FALSE; } } if (bMakeNewBoundary) { //Reset all state just in case SAFERELEASE(m_pCurrentThing); SAFERELEASE(m_pCurrentThingFrame); SAFERELEASE(m_pCurrentBoundaryList); SAFERELEASE(m_pBoundary); m_cVertices = 0; hr = StartNewBoundary( &m_pBoundary ); if( FAILED(hr) || !m_pBoundary) { MessageBeep(MB_ICONASTERISK); goto EXIT_FAIL; } m_nFirstVertexX = ptScreen.x; m_nFirstVertexY = ptScreen.y; // Assume we fail. m_fLastVertexLegal = FALSE; // Insert first vertex offset by Thing's position //hr = m_2DThingXform.TransformToThingCoords( &flX, &flY, &flZ); //if(FAILED(hr)) goto EXIT_FAIL; vec.x = flX; vec.y = flY; vec.z = flZ; m_pCurrentThingFrame->InverseTransform(AXIS_Y, &vec.x, &vec.y, &vec.z, vec.x, vec.y, vec.z); hr = m_pBoundary->InsertVertex(-1, vec.x, vec.z); if( FAILED(hr) ) goto EXIT_FAIL;//.........这里部分代码省略.........
开发者ID:opensim4opencog,项目名称:PrologVirtualWorlds,代码行数:101,
示例12: ASSERT///////////////////////////////////////////////////////////////////////////////++//// CBasePropertyPage::HrInit//// Description:// Initialize the page.//// Arguments:// peoInout// Pointer to the extension object.//// Return Value:// S_OK// Page initialized successfully.//// Other HRESULTs// Page failed to initialize.////--/////////////////////////////////////////////////////////////////////////////HRESULTCBasePropertyPage::HrInit( CExtObject * peoInout ){ ASSERT( peoInout != NULL ); AFX_MANAGE_STATE( AfxGetStaticModuleState() ); HRESULT hr = S_OK; CWaitCursor wc; DWORD sc = ERROR_SUCCESS; CClusPropList cpl; m_peo = peoInout; // // Don't display a help button. // m_psp.dwFlags &= ~PSP_HASHELP; // // Construct the property page. // if ( Peo()->BWizard() ) { ASSERT( IddWizardPage() != NULL); Construct( IddWizardPage(), IdsCaption() ); } // if: adding page to wizard else { ASSERT( IddPropertyPage() != NULL ); Construct( IddPropertyPage(), IdsCaption() ); } // else: adding page to property sheet // // Read the properties private to this resource and parse them. // ASSERT( Peo() != NULL ); ASSERT( Peo()->PodObjData() ); // // Read the properties. // switch ( Cot() ) { case CLUADMEX_OT_CLUSTER: { CClusterData * pccd = reinterpret_cast< CClusterData * >( Peo()->PodObjData() ); ASSERT( pccd && (pccd->GetHCluster() != NULL) ); sc = cpl.ScGetClusterProperties( pccd->GetHCluster() , CLUSCTL_CLUSTER_GET_PRIVATE_PROPERTIES ); break; } case CLUADMEX_OT_NODE: { CNodeData * pcnd = reinterpret_cast< CNodeData * >( Peo()->PodObjData() ); ASSERT( pcnd && (pcnd->GetHNode() != NULL) ); sc = cpl.ScGetNodeProperties( pcnd->GetHNode() , CLUSCTL_NODE_GET_PRIVATE_PROPERTIES ); break; } case CLUADMEX_OT_GROUP: { CGroupData * pcgd = reinterpret_cast< CGroupData * >( Peo()->PodObjData() ); ASSERT( pcgd && (pcgd->GetHGroup() != NULL) ); sc = cpl.ScGetGroupProperties( pcgd->GetHGroup() , CLUSCTL_GROUP_GET_PRIVATE_PROPERTIES ); break;//.........这里部分代码省略.........
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:101,
示例13: AFX_MANAGE_STATEbool CTestDigitizerPlugIn::EnableDigitizer( bool bEnable ){ // In case we need to access our resources... AFX_MANAGE_STATE( AfxGetStaticModuleState() ); // In case we need Rhino main window handle... HWND hwndRhino = RhinoApp().MainWnd(); bool rc = false; if( bEnable ) { for( ;; ) { if( m_bDigitizerConnected ) { ::RhinoApp().Print( L"Digitizer already connected./n" ); rc = true; break; } ::RhinoApp().Print( L"Connecting to digitizer .../n" ); /* Do whatever it takes to connnect to and initialize your digitizer here. If you need to call LoadLibrary() to load some communication DLL, do it here. Once you have connected and initialized your digitizer, you can create the polling thread. */ // Start up the polling thread m_hThread = ::CreateThread( NULL, 0, ThreadProc, this, 0, &m_dwThreadID ); m_bDigitizerConnected = true; rc = true; break; } } else { if( !m_bDigitizerConnected ) return true; if( m_hThread ) { ::TerminateThread( m_hThread, 0 ); ::CloseHandle( m_hThread ); m_hThread = 0; } /* Shut down communications with the digitizer here. If you need to call FreeLibrary to release a communications DLL, do it here. */ m_dwThreadID = 0; m_bDigitizerConnected = false; rc = true; } return rc;}
开发者ID:buonmethuoc,项目名称:Rhino4Samples_CPP,代码行数:63,
示例14: AFX_MANAGE_STATE//-------------------------------------------------------------------------------------------------//// Class: CHL2LoaderPlugIn// // Function: Init// // Description: Initializes this particular plug-in////-------------------------------------------------------------------------------------------------//bool CHL2LoaderPlugIn::Init(){ AFX_MANAGE_STATE(AfxGetStaticModuleState()); return true;} // End of Init for CHL2LoaderPlugIn
开发者ID:kohachiro,项目名称:RenderMonkeyHL2,代码行数:13,
示例15: DllCanUnloadNowSTDAPI DllCanUnloadNow(void){ AFX_MANAGE_STATE(AfxGetStaticModuleState()); return AfxDllCanUnloadNow();}
开发者ID:NickSerg,项目名称:PDFLibNet,代码行数:5,
示例16: AFX_MANAGE_STATEHRESULT CMultimediaExemplarObject::InstallHostExtensions(IModule* pModule){ AFX_MANAGE_STATE(AfxGetStaticModuleState()) HRESULT hr = S_OK; CComPtr<IThing> pHostEx; CComBSTR bstrName; CComBSTR bstrNameInternal; CComPtr<IPropertyList> pMenu; CComPtr<IPropertyList> pPeerMenu; CComPtr<IMenuItem> pMenuItem; hr = m_pWorld->get_Exemplar(CComBSTR("Host"), &pHostEx); // Delete the peer menu, the current peer menu, which won't have MM additions (Approach...) hr = pHostEx->RemoveProperty(CComBSTR("PeerMenu")); if (FAILED(hr)) { VWTRACE(m_pWorld, "VWMM", VWT_ERROR, "CMultimediaExemplarObject::InstallHostExtensions Unable to remove peer menu, hr = %x/n", hr); goto ERROR_ENCOUNTERED; } // Now re-get the menu (this will get the avatar MM version) and re-add LogOff hr = pHostEx->get_ObjectProperty(CComBSTR("PeerMenu"), (IObjectProperty**) &pPeerMenu); if (FAILED(hr)) goto ERROR_ENCOUNTERED; // make a copy (since not COPYONGET) hr = CreateMenu(m_pWorld, &pMenu); if (FAILED(hr)) goto ERROR_ENCOUNTERED; hr = pPeerMenu->CopyTo(pMenu); if (FAILED(hr)) goto ERROR_ENCOUNTERED; // Add Log off... to peer menu list hr = CreateMenuItemExt( m_pWorld, CComBSTR("Log off..."), 0, NULL, CComBSTR("UpdateIsAvatarAndNotWizard"), CComBSTR("ShowLogOffDialog"), NULL, &pMenuItem); if (FAILED(hr)) goto ERROR_ENCOUNTERED;// pMenuItem->put_SortOrder(MI_SORT_PRIMARY+110); hr = pMenuItem->put_AddTargetParameter(VARIANT_TRUE); if (FAILED(hr)) goto ERROR_ENCOUNTERED; hr = pMenu->AddObjectProperty(pMenuItem); if (FAILED(hr)) goto ERROR_ENCOUNTERED; hr = pHostEx->put_ObjectProperty(CComBSTR("PeerMenu"), pMenu);ERROR_ENCOUNTERED: if (hr != S_OK) VWTRACE(m_pWorld, "VWMM", VWT_ERROR, "CMultimediaExemplarObject::Install Error encountered/n"); return hr;}
开发者ID:opensim4opencog,项目名称:PrologVirtualWorlds,代码行数:61,
示例17: AFX_MANAGE_STATE// This is called when the user first loads the add-in, and on start-up// of each subsequent Developer Studio sessionSTDMETHODIMP CDSAddIn::OnConnection(IApplication* pApp, VARIANT_BOOL bFirstTime, long dwCookie, VARIANT_BOOL* OnConnection){ AFX_MANAGE_STATE(AfxGetStaticModuleState()); // Store info passed to us IApplication* pApplication = NULL; if (FAILED(pApp->QueryInterface(IID_IApplication, (void**) &pApplication)) || pApplication == NULL) { *OnConnection = VARIANT_FALSE; return S_OK; } g_pApplication = pApplication; m_dwCookie = dwCookie; // Create command dispatch, send info back to DevStudio CCommandsObj::CreateInstance(&m_pCommands); m_pCommands->AddRef(); // The QueryInterface above AddRef'd the Application object. It will // be Release'd in CCommand's destructor. m_pCommands->SetApplicationObject(pApplication); // (see stdafx.h for the definition of VERIFY_OK) VERIFY_OK(pApplication->SetAddInInfo((long) AfxGetInstanceHandle(), (LPDISPATCH) m_pCommands, IDR_TOOLBAR_MEDIUM, IDR_TOOLBAR_LARGE, m_dwCookie)); // Inform DevStudio of the commands we implement // TODO: Replace the AddCommand call below with a series of calls, // one for each command your add-in will add. // The command name should not be localized to other languages. The // tooltip, command description, and other strings related to this // command are stored in the string table (IDS_CMD_STRING) and should // be localized. LPCTSTR szCommand = _T("ShowFunctionsAddinCommand"); VARIANT_BOOL bRet; CString strCmdString; strCmdString.LoadString(IDS_CMD_STRING); strCmdString = szCommand + strCmdString; CComBSTR bszCmdString(strCmdString); CComBSTR bszMethod(_T("ShowFunctionsAddinCommandMethod")); CComBSTR bszCmdName(szCommand); VERIFY_OK(pApplication->AddCommand(bszCmdString, bszMethod, 0, m_dwCookie, &bRet)); if (bRet == VARIANT_FALSE) { // AddCommand failed because a command with this name already // exists. You may try adding your command under a different name. // Or, you can fail to load as we will do here. *OnConnection = VARIANT_FALSE; return S_OK; } // Add toolbar buttons only if this is the first time the add-in // is being loaded. Toolbar buttons are automatically remembered // by Developer Studio from session to session, so we should only // add the toolbar buttons once. if (bFirstTime == VARIANT_TRUE) { VERIFY_OK(pApplication-> AddCommandBarButton(dsGlyph, bszCmdName, m_dwCookie)); } // Create the WWhizInterface. g_wwhizInterface = WWhizInterface2Create(AfxGetInstanceHandle(), pApplication); *OnConnection = VARIANT_TRUE; return S_OK;}
开发者ID:Luomu,项目名称:workspacewhiz,代码行数:75,
示例18: BEGIN_MESSAGE_MAP//// Please see MFC Technical Notes 33 and 58 for additional// details.//// CAppResourcesAppBEGIN_MESSAGE_MAP(CAppResourcesApp, CWinApp)END_MESSAGE_MAP()// CAppResourcesApp constructionCAppResourcesApp::CAppResourcesApp(){ AFX_MANAGE_STATE(AfxGetStaticModuleState())}// The one and only CAppResourcesApp objectCAppResourcesApp theApp;// CAppResourcesApp initializationBOOL CAppResourcesApp::InitInstance(){ CWinApp::InitInstance(); return TRUE;
开发者ID:BlueSpells,项目名称:MapGen,代码行数:31,
注:本文中的AfxGetStaticModuleState函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AfxGetThreadState函数代码示例 C++ AfxGetResourceHandle函数代码示例 |