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


C++ GetApp函数代码示例

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


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

示例1: AFX_MANAGE_STATE

IComparison* Comparisons::Open(LPCTSTR wdfDocId)
{
	AFX_MANAGE_STATE(AfxGetAppModuleState());
	AutomationInteractionSuppressor ais;


	CMDIFrameWnd* pMainFrame = DYNAMIC_DOWNCAST(CMDIFrameWnd, AfxGetMainWnd());
	GetApp()->RealFileNew();
// TODO - can we get the frame in a better way
	CChildFrame *pFrame = DYNAMIC_DOWNCAST( CChildFrame, pMainFrame->MDIGetActive() );

	if (pFrame)
	{
	// TODO - do we need this
		GetDVController(pFrame)->CloseDocument(true);
		GetDVController(pFrame)->CloseDocument(false);

		GetDVController(pFrame)->CloseCompositeDocument();
		GetDVController(pFrame)->GetComparisonDocController().CloseComparisonDocument();

		if( pFrame->GetCompositeBar() )
			pFrame->GetCompositeBar()->OnInitialUpdate();

		pFrame->ShowWindow(SW_SHOW);
		pFrame->BringWindowToTop();

		if (!GetDVController(pFrame)->LoadWDF(wdfDocId))
		{
			AfxThrowOleDispatchException(1102, L"File not found : " + CString(wdfDocId));
		}


		pFrame->GetDocument()->UpdateAllViews(NULL);
		UpdateOpenList();
		return FindComObject(pFrame->GetDocument());
	}
	AfxThrowOleDispatchException(1101, L"Internal Error");
	return NULL;
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:39,代码来源:Comparisons.cpp

示例2: GetRotateMatrix

void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS,
                                     CFX_Matrix* pMatrix,
                                     FX_DWORD dwStatus,
                                     int32_t iRotate) {
  if (!IsMatchVisibleStatus(dwStatus)) {
    return;
  }
  CFX_Matrix mtRotate;
  GetRotateMatrix(mtRotate);
  if (pMatrix) {
    mtRotate.Concat(*pMatrix);
  }
  CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus);
  RenderHighlightCaption(pGS, &mtRotate);
  CFX_RectF rtWidget;
  GetRectWithoutRotate(rtWidget);
  CFX_Matrix mt;
  mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top);
  mt.Concat(mtRotate);
  GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(),
                                                 pGS, &mt);
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:22,代码来源:xfa_ffpushbutton.cpp

示例3: AFX_MANAGE_STATE

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

	short nStoreOption = Workshare::OptionApi::GetInt(L"DocFormat");

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

	Workshare::OptionApi::SetInt(L"DocFormat", -1);
	long lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode();
	assertTest(lRetVal == WSCONVERTERLib::dvFormatWDF);

	Workshare::OptionApi::SetInt(L"DocFormat", 6);
	lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode();
	assertTest(lRetVal == WSCONVERTERLib::dvFormatRTF);

	Workshare::OptionApi::SetInt(L"DocFormat", 0);
	lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode();
	assertTest(lRetVal == WSCONVERTERLib::dvFormatDocument);

	Workshare::OptionApi::SetInt(L"DocFormat", 12);
	lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode();
	assertTest(lRetVal == WSCONVERTERLib::dvFormatXMLDocument);

	Workshare::OptionApi::SetInt(L"DocFormat", 2);
	lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode();
	assertTest(lRetVal == WSCONVERTERLib::dvFormatText);

	Workshare::OptionApi::SetInt(L"DocFormat", -7);
	lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode();
	assertTest(lRetVal == WSCONVERTERLib::dvFormatPDF);

	//check for default
	Workshare::OptionApi::SetInt(L"DocFormat", 50);
	lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode();
	assertTest(lRetVal == WSCONVERTERLib::dvFormatWDF);

	Workshare::OptionApi::SetInt(L"DocFormat", nStoreOption);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:41,代码来源:DVControllerTests.cpp

示例4: GetApp

BOOL COptFont::OnInitDialog()
{
	u32 i;
	GF_BaseInterface *ifce;

	CDialog::OnInitDialog();

	COsmo4 *gpac = GetApp();
	TCHAR wTmp[500];
	const char *sOpt;

	/*video drivers enum*/
	while (m_Fonts.GetCount()) m_Fonts.DeleteString(0);
	sOpt = gf_cfg_get_key(gpac->m_user.config, "FontEngine", "DriverName");
	s32 to_sel = 0;
	s32 select = 0;
	u32 count = gf_modules_get_count(gpac->m_user.modules);
	for (i=0; i<count; i++) {
		ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_FONT_READER_INTERFACE);
		if (!ifce) continue;
		if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
		CE_CharToWide((char *) ifce->module_name, (u16 *)wTmp);
		m_Fonts.AddString(wTmp);
		gf_modules_close_interface(ifce);
		to_sel++;
	}
	m_Fonts.SetCurSel(select);


	sOpt = gf_cfg_get_key(gpac->m_user.config, "FontEngine", "FontDirectory");
	CE_CharToWide((char *)sOpt, (u16 *)wTmp);
	if (sOpt) m_BrowseFont.SetWindowText(wTmp);

	sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "TextureTextMode");
	m_UseTexture.SetCheck( (!sOpt || stricmp(sOpt, "Never")) ? 1 : 0);

	return TRUE;
}
开发者ID:erelh,项目名称:gpac,代码行数:38,代码来源:Options.cpp

示例5: LOWORD

BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
	int ID = LOWORD(wParam);
	WinGPAC *app = GetApp();

	if ( (ID>=ID_VP_0) && (ID<=ID_VP_0+nb_viewpoints)) {
		ID -= ID_VP_0;
		M4T_SetViewpoint(app->m_term, ID+1, NULL);
		return TRUE;
	}
	if ( (ID>=ID_NAV_PREV_0) && (ID<=ID_NAV_PREV_9)) {
		ID -= ID_NAV_PREV_0;
		s32 prev = m_pPlayList->m_cur_entry - ID;
		if (prev>=0) {
			m_pPlayList->m_cur_entry = prev;
			m_pPlayList->PlayPrev();
		}
		return TRUE;
	}
	if ( (ID>=ID_NAV_NEXT_0) && (ID<=ID_NAV_NEXT_9)) {
		ID -= ID_NAV_NEXT_0;
		u32 next = m_pPlayList->m_cur_entry + ID;
		if (next < ChainGetCount(m_pPlayList->m_entries) ) {
			m_pPlayList->m_cur_entry = next;
			m_pPlayList->PlayNext();
		}
		return TRUE;
	}
	if ( (ID>=ID_SELOBJ_0) && (ID<=ID_SELOBJ_9)) {
		ID -= ID_SELOBJ_0;
		LPODMANAGER root_od = M4T_GetRootOD(app->m_term);
		if (!root_od) return TRUE;
		LPODMANAGER odm = M4T_GetODManager(app->m_term, root_od, ID);
		M4T_SelectOD(app->m_term, odm);
		return TRUE;
	}
	return CFrameWnd::OnCommand(wParam, lParam);
}
开发者ID:DmitrySigaev,项目名称:DSMedia,代码行数:38,代码来源:MainFrm.cpp

示例6: GetApp

bool COptionsDlgSelector::ValidateFileFormats(const CStdString& sResolvedDocID1, const int nIndex, const CStdString& sResolvedDocID2)
{
	// If neither of the docs are PDF then they'll valid
	// (for the purposes of this method)
	HRESULT hr = FileTypeHelper::IsPDF(sResolvedDocID1);
	if (FAILED(hr))	// test DMS connection good first
		return false;

	HRESULT hr2 = FileTypeHelper::IsPDF(sResolvedDocID2);
	if (FAILED(hr2))
		return false;

	if( S_OK != hr && S_OK == hr2 )
		return true;

	if(!Workshare::OptionApi::GetBool(L"EnablePDFCompare"))
	{
		GetApp()->ShowMessageEx(AfxGetMainWnd()->m_hWnd, L"Your system administrator has disabled PDF comparisons.", WsOK, WsDefault, WsInfoIcon, L"", functionality_not_available, LOG_LOCATION);
		return false;
	}

	return true;
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:23,代码来源:OptionsDlgSelector.cpp

示例7: GetApp

void CEditProjectMgr::UpdateBUTFile()
{
	//get the resource directory for the currently open project, and add on
	//our filename to get the BUT file
	CString sBUTFile = m_BaseProjectDir + "\\ClassHlp.but";

	//now create a but manager to load this
	CButeMgr* pNewMgr = new CButeMgr;

	//bail if memory failed
	if(pNewMgr == NULL)
		return;

	if (!pNewMgr->Parse(sBUTFile))
	{
		//failed to find a new but file, no worries, just bail
		delete pNewMgr;
		return;
	}

	//this worked, we want to override the old but file with this one
	GetApp()->SetClassHelpButeAgg(pNewMgr);
	
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:24,代码来源:EditProjectMgr.cpp

示例8: gf_list_get

void Playlist::RefreshList()
{
	u32 i, top_idx;
	char szPath[GF_MAX_PATH];

	top_idx = m_FileList.GetTopIndex();
	m_FileList.DeleteAllItems();

	for (i=0; i<gf_list_count(m_entries); i++) {
		PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
		m_FileList.InsertItem(i, "");
		m_FileList.SetItemData(i, (u32) ple);

		UpdateEntry(i);
		/*in case of sorting*/
		if (ple->m_bIsPlaying) m_cur_entry = i;

		if (ple->m_bIsSelected) {
			m_FileList.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
			ple->m_bIsSelected = GF_FALSE;
		}
	}

	if (m_cur_entry >= (s32)gf_list_count(m_entries)) m_cur_entry = gf_list_count(m_entries);
	else {
		s32 last_idx = top_idx + m_FileList.GetCountPerPage();
		m_FileList.EnsureVisible(top_idx, 0);
		if (gf_list_count(m_entries)<(u32) last_idx) last_idx = gf_list_count(m_entries);
		m_FileList.EnsureVisible(last_idx, 1);
	}


	strcpy((char *) szPath, GetApp()->szUserPath);
	strcat(szPath, "gpac_pl.m3u");
	Save(szPath, GF_TRUE);
}
开发者ID:Bevara,项目名称:Access,代码行数:36,代码来源:Playlist.cpp

示例9: GetRotateMatrix

void CXFA_FFField::RenderWidget(CFX_Graphics* pGS,
                                CFX_Matrix* pMatrix,
                                uint32_t dwStatus) {
  if (!IsMatchVisibleStatus(dwStatus)) {
    return;
  }
  CFX_Matrix mtRotate;
  GetRotateMatrix(mtRotate);
  if (pMatrix) {
    mtRotate.Concat(*pMatrix);
  }
  CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus);
  CXFA_Border borderUI = m_pDataAcc->GetUIBorder();
  DrawBorder(pGS, borderUI, m_rtUI, &mtRotate);
  RenderCaption(pGS, &mtRotate);
  DrawHighlight(pGS, &mtRotate, dwStatus, FALSE);
  CFX_RectF rtWidget;
  m_pNormalWidget->GetWidgetRect(rtWidget);
  CFX_Matrix mt;
  mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top);
  mt.Concat(mtRotate);
  GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(),
                                                 pGS, &mt);
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:24,代码来源:xfa_fffield.cpp

示例10: GetDlgItem

BOOL COrderFailedDialog::OnInitDialog()
{
	CBaseDialog::OnInitDialog();
	
	CMlsPropertyControl::SubclassPropertyControls(this);
	
	// If there is no help number, get rid of the reference.
	CWnd* pHelp = GetDlgItem(IDC_HELP_INFO);
	if (pHelp != NULL)
	{
		CInternationalData* pInternationalData = GetApp()->GetInternationalData();
		if (pInternationalData != NULL)
		{
			if (!pInternationalData->m_InstantSales.m_Help.Exists())
			{
				pHelp->ShowWindow(SW_HIDE);
			}
		}
	}
	
	CenterWindow();
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:24,代码来源:ORDFAIL.CPP

示例11: OnTimer

void CDocSelector::OnTimer(UINT nIDEvent) 
{
	for ( int i = 0; i < m_Buttons.GetSize(); i++ )
	{
		CSwitcherButton* wndButton = 
			(CSwitcherButton *) m_Buttons.GetAt( i );

		// May be the user has destroyed the view...
		if ( wndButton->m_AttachedView )
		{

			// Modified by Bender to fix akward problem with CFormView and GetFocus()
			// MFC works in misterious ways ;)
			if(GetApp()->GetMainFrame()->MDIGetActive() == wndButton->m_AttachedView->GetParentFrame())
			//if ( GetFocus() == wndButton->m_AttachedView)
			{
				if ( wndButton->m_nState != SWITCHBUTTON_SELECTED )
				{
					wndButton->Select();

					m_iSelectedButton = i;
				}
			}
			else
			{
				if ( wndButton->m_nState == SWITCHBUTTON_SELECTED )
					wndButton->Unselect();
			}
		}
		// Yes, he has, critical condition..., break...
		else
			break;
	}

	CControlBar::OnTimer(nIDEvent);
}
开发者ID:MXControl,项目名称:RoboMX,代码行数:36,代码来源:DocSelect.cpp

示例12: GetApp

void CommandSystem::Draw() {

	if (!mCommandMode)  return;

	int nHeight = GetApp()->getHeight() * 0.7f;
	GetApp()->text_->SetInsertionPos(50, nHeight);
	GetApp()->text_->SetForegroundColor(D3DXCOLOR(0.0f, 0.0f, 0.0f, 1.0f));
	GetApp()->text_->DrawFormattedTextLine(mStatusLine.c_str());

	idStr displayString = "edit";
	GetApp()->text_->SetInsertionPos(50, nHeight+10);

	displayString += "> ";
	displayString += mCommand.c_str();	
	if (timeGetTime() & 0x200)
	{
		displayString += "_";
	}
	GetApp()->text_->DrawFormattedTextLine(displayString.c_str());

}
开发者ID:DanielNeander,项目名称:my-3d-engine,代码行数:21,代码来源:CommandSystem.cpp

示例13: Initialize

	status_t Initialize()
	{
		try
		{
			//os::RegistrarManager* pcRegManager = os::RegistrarManager::Get();
			/* Register remote calls */
			pcPlayEvent = os::Event::Register( "media/Coldfish/Play","Play",GetApp(),CF_GUI_PLAY);
			pcStopEvent = os::Event::Register( "media/Coldfish/Stop","Stop",GetApp(),CF_GUI_STOP);
			pcPauseEvent = os::Event::Register( "media/Coldfish/Pause","Pause",GetApp(),CF_GUI_PAUSE);
			pcNextEvent = os::Event::Register( "media/Coldfish/Next","Next",GetApp(),CF_PLAY_NEXT);
			pcPrevEvent = os::Event::Register( "media/Coldfish/Previous","Previous",GetApp(),CF_PLAY_PREVIOUS);
			pcGetSongEvent = os::Event::Register( "media/Coldfish/GetSong", "Gets the current song",GetApp(), CF_GET_SONG);
			pcGetPlayStateEvent = os::Event::Register( "media/Coldfish/GetPlayState", "Gets the current playstate",GetApp(), CF_GET_PLAYSTATE);
			pcAddFileEvent = os::Event::Register( "media/Coldfish/AddFile", "Calls the file requester to add a file to ColdFish",GetApp(), CF_GUI_ADD_FILE);			
			pcAboutEvent = os::Event::Register( "media/Coldfish/About", "Calls the about box",GetApp(), CF_GUI_ABOUT);	
		} catch( ... )
		{
			return( -1 );
		}
		return( 0 );
	}
开发者ID:PyroOS,项目名称:Pyro,代码行数:21,代码来源:Remote.cpp

示例14: RenderToBackBuffer

//--------------------------------------------------------------------------------------
// Render the scene using the D3D11 device
//--------------------------------------------------------------------------------------
void RenderToBackBuffer(Renderer* renderer, double fTime, float fElapsedTime, void* pUserContext)
{
	ID3D11DeviceContext* pContext =  GetApp()->GetContext();
	
	// Something's wrong in the shader and the tri size is out by a factor of 2.  Why?!?
	g_pTriSizeVar->SetInt(2 * g_tessellatedTriWidth);

	const bool debugDrawPatches = false;
	g_DebugShowPatchesVar->SetBool(debugDrawPatches);

	const bool debugDrawTiles = false;
	g_DebugShowTilesVar->SetBool(debugDrawTiles);

	const float wireAlpha = 0.01f * (float)80;

	// Below 1.0, we fade the lines out with blending; above 1, we increase line thickness.
	if (wireAlpha < 1)
	{
		g_WireAlphaVar->SetFloat(wireAlpha);
		g_WireWidthVar->SetFloat(1);
	}
	else
	{
		g_WireAlphaVar->SetFloat(1);
		g_WireWidthVar->SetFloat(wireAlpha);
	}

	g_DetailNoiseVar->SetFloat(0.001f * (float)g_DetailNoiseScale);

	float samplesapcing = WORLD_SCALE * g_pTileRings[g_nRings-1]->outerWidth() / (float) COARSE_HEIGHT_MAP_SIZE;
	g_SampleSpacingVar->SetFloat(samplesapcing);

	// If the settings dialog is being shown, then render it instead of rendering the app's scene		

	BaseCamera* pCam = GetApp()->ActiveCam_;
	D3DXMATRIX mProj;
	D3DXMATRIX mView;

	const unsigned int size16 = sizeof(float) * 16;		 
	memcpy(&mView, pCam->getViewMatrix(), size16);
	memcpy(&mProj, pCam->getProjectionMatrix(), size16);


	SetViewport(pContext, g_BackBufferVP);

	D3DXMATRIX mViewCopy = mView;
	mViewCopy._41 = mViewCopy._42 = mViewCopy._43 = 0;
	D3DXMATRIX mWVP = StarWorldMatrix() * mViewCopy * mProj;
	if (!g_CheckForCracks)
		g_Skybox.D3D11Render(&mWVP, pContext);

	RenderStars(pContext, mViewCopy, mProj, g_ScreenSize);

	int vec[3] = { g_RidgeOctaves, g_fBmOctaves, g_TexTwistOctaves };
	g_pFractalOctavesTVar->SetIntVector(vec);

	// I'm still trying to figure out if the detail scale can be derived from any combo of ridge + twist.
	// I don't think this works well (nor does ridge+twist+fBm).  By contrast the relationship with fBm is
	// straightforward.  The -4 is a fudge factor that accounts for the frequency of the coarsest ocatve
	// in the pre-rendered detail map.
	const float DETAIL_UV_SCALE = powf(2.0f, std::max(g_RidgeOctaves, g_TexTwistOctaves) + g_fBmOctaves - 4.0f);
	g_DetailUVVar->SetFloatVector(D3DXVECTOR2(DETAIL_UV_SCALE, 1.0f/DETAIL_UV_SCALE));

	SetUVOffset(g_pUVOffsetTVar);

	/*ID3D11Query* pFreeQuery = FindFreeQuery();
	if (pFreeQuery)
		pContext->Begin(pFreeQuery);*/
		
	RenderTerrain(pContext, mProj, g_BackBufferVP);

	//if (pFreeQuery)
	//	pContext->End(pFreeQuery);

	//for (int i=0; i!=N_QUERIES; ++i)
	//{
	//	if (!g_FreePipelineQueries[i] && g_PipelineQueries[i])	// in use & exists
	//	{
	//		D3D11_QUERY_DATA_PIPELINE_STATISTICS stats;
	//		if (S_OK == pContext->GetData(g_PipelineQueries[i], &stats, sizeof(stats), D3D11_ASYNC_GETDATA_DONOTFLUSH))
	//		{
	//			g_PrimitivesRendered = stats.CInvocations;
	//			g_FreePipelineQueries[i] = g_PipelineQueries[i];	// Put back on free list.
	//		}
	//	}
	//}		
}
开发者ID:DanielNeander,项目名称:my-3d-engine,代码行数:90,代码来源:Dx11TerrainTests.cpp

示例15: GetApp

void CWorldsDlg::OnFileNewWorld()
{
	GetApp()->OnFileNewWorld();
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:4,代码来源:WorldsDlg.cpp


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