• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetApp函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: switch

bool PlayerManager::Entry( DNID dnidClient, LINKSTATUS enumStatus, void *data, size_t size )
{
	//这里收到玩家启动客户端的消息,发送服务器状态
	SMessage *pMsg = (SMessage *)data;
	if ( pMsg == NULL )
	{
		return true;
	}

	//给客户端发送服务器状态数据

	if ( pMsg->_protocol == pMsg->EPRO_Center_MESSAGE )
	{
		SCenterBaseMsg* _pMsg = static_cast< SCenterBaseMsg* >( pMsg );
		switch (_pMsg->_protocol)
		{
		case SCenterBaseMsg::EPRO_RequestClientVersionInfo: //返回当前游戏资源更新信息
		{
			SARequestAssetUpdateInfo _msg;
			CDAppMain& appMain = GetApp();
			_msg.streamLength = appMain.m_iAssetBundleInfoLength;
			memcpy(_msg.streamData, appMain.m_AssetbundleVersionInfo, appMain.m_iAssetBundleInfoLength);
			SendToClient(dnidClient, &_msg, sizeof(SARequestAssetUpdateInfo) - (MAX_ASSET_SIZE - appMain.m_iAssetBundleInfoLength));

			//rfalse(2, 1, "");
		}
			break;
		case SCenterBaseMsg::EPRO_RequestServerState:
		{
			//接受请求数据
			SARequestServerState _msg;
			bool b = GetApp().m_ServerManager[GAMESERVER_FLAG].GetGameServerList(&_msg);
			if (b)
			{
				SendToClient(dnidClient, &_msg, _msg.MySize());

				m_dPlayerConnectNum++;
				char string[100] = {};
				sprintf_s(string, "\nPlayeConnectCenterServer: %d  ", m_dPlayerConnectNum);
				GetApp().SaveConnectNumString(string);
			}
		}
			break;
		case SCenterBaseMsg::EPRO_RequestServerDetailInfo:
		{
			SQRequestServeDetailInfoMsg *psrcMsg = static_cast<SQRequestServeDetailInfoMsg*>(pMsg);
			if (NULL == psrcMsg)
				break;
			ServerData *pServerData = NULL;
			GameServer *pGameServer = NULL;
			if (GetApp().m_ServerManager[GAMESERVER_FLAG].FindGameServerByIndex(psrcMsg->dwIndex, &pGameServer))
			{
				if (NULL != pGameServer)
				{
					pServerData = pGameServer->GetServerData();
				}
			}
			if (NULL != pServerData)
			{
				SARequestServeDetailInfoMsg msg;
				msg.dwIndex = pServerData->m_dwIndex;
				lite::Serializer sl(msg.streamData, sizeof(msg.streamData));
				sl(pServerData->m_dwIP)(pServerData->m_dwPort);
				SendToClient(dnidClient, &msg, sizeof(msg) - sl.EndEdition());
			}
		}
			break;
		default:
			break;
		}
	}
	else if (pMsg->_protocol == SMessage::EPRO_SYSTEM_MESSAGE)
	{
		SQLoginMsg* _pMsg = static_cast<SQLoginMsg*>(pMsg);
	}

	return true;
}
开发者ID:luw630,项目名称:Server,代码行数:78,代码来源:PlayerManager.cpp


示例17: GetApp

BOOL COrderFormInformationDialog::PrintOrderForm()
{
	COrderForm OrderForm;

	CString csFormat;
	
	CString csOfferCode;
	Util::SafeLoadString(IDS_OFFER_CODE, csFormat);
	csOfferCode.Format(csFormat, GetApp()->Offer()->OfferCode());
	OrderForm.AddStringMapping("~RCODE", csOfferCode);
	
	CString csFaxNumber = GetApp()->GetFaxNumber();
	OrderForm.AddStringMapping("~LFAXNUMBER", csFaxNumber);
	
	int nIndex = 1;
	CString csValue;
	
	wsprintf(csValue.GetBuffer(128), "%s %s", (LPCSTR)m_csFirstName, (LPCSTR)m_csLastName);
	csValue.ReleaseBuffer();
	OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, csValue);
	
	if (!m_csCompany.IsEmpty())
	{
		OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, m_csCompany);
	}
	
	if (!m_csAddress1.IsEmpty())
	{
		OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, m_csAddress1);
	}
	
	if (!m_csAddress2.IsEmpty())
	{
		OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, m_csAddress2);
	}

	wsprintf(csValue.GetBuffer(128), "%s, %s  %s", (LPCSTR)m_csCity, (LPCSTR)m_csState, (LPCSTR)m_csZip);
	csValue.ReleaseBuffer();
	OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, csValue);
	
	if (m_wCountryId != COUNTRY_UnitedStatesOfAmerica)
	{
		OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, m_csCountry);
	}

	if (!m_csPhone.IsEmpty())
	{
		OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, m_csPhone);
	}
	
	nIndex = 1;

	CString csPaymentMethod;
	Util::SafeLoadString(PaymentMethodNames[m_nPaymentMethod], csPaymentMethod);
	OrderForm.AddIndexedStringMapping("~LPAYMENTMETHOD", nIndex++, csPaymentMethod);
	
	if ((m_nPaymentMethod >= CCreditCard::VISA) && (m_nPaymentMethod <= CCreditCard::DISCOVER))
	{
		csValue = m_csCardNumber;
		CCreditCard::PrettyCreditCardNumber(m_nPaymentMethod, csValue);
		OrderForm.AddIndexedStringMapping("~LPAYMENTMETHOD", nIndex++, csValue);

		Util::SafeLoadString(IDS_EXPIRES, csFormat);
		csValue.Format(csFormat, m_csExpirationDate);
		OrderForm.AddIndexedStringMapping("~LPAYMENTMETHOD", nIndex++, csValue);
	}
	
	CInternationalData* pInternationalData = GetApp()->GetInternationalData();
	if (pInternationalData != NULL)
	{
		CNameList MailList(pInternationalData->m_InstantSales.m_Mail.m_szAddress);
		for (nIndex = 1; nIndex <= MailList.GetSize(); nIndex++)
		{
			csValue = MailList.ElementAt(nIndex-1);
			PerformIniKeySubstitution(csValue);
			OrderForm.AddIndexedStringMapping("~LMAILADDRESS", nIndex, csValue);
		}
	}

	Util::SafeLoadString(IDS_PRINTED, csFormat);

	CString csDate;

#ifdef WIN32
	SYSTEMTIME SystemTime;
	GetLocalTime(&SystemTime);

	csDate.Format(
		csFormat,
		(int)SystemTime.wMonth,
		(int)SystemTime.wDay,
		(int)(SystemTime.wYear % 100),
		(int)SystemTime.wHour,
		(int)SystemTime.wMinute,
		(int)SystemTime.wSecond);
#else
	time_t BinaryTime;
	time(&BinaryTime);
	CTime Time(BinaryTime);

//.........这里部分代码省略.........
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:101,代码来源:MAILORD.CPP


示例18: GameOnSelect

void GameOnSelect( VariantList* pVList )
{
	Entity *pEntClicked = pVList->m_variant[1].GetEntity();

	Tetris* tetris = Tetris::GetInstance();
	Config* config = Config::GetInstance();

	if( pEntClicked->GetName() == GUI_IMAGEBUTTON_GAMEPLAY_MENU_BUTTON )
	{
		GetApp()->buttonClickSound();

		if( tetris->isEndGame() )
		{
			SlideScreen( pEntClicked->GetParent(), false );
			GetMessageManager()->CallEntityFunction( pEntClicked->GetParent(), 500, "OnDelete", NULL );
		
			GetApp()->setGame( false );
			GetApp()->setContinueBtn( false );

			if( tetris->getScoreInt() > config->getMinScore() )
			{
				GameState::SetState( new GS_Menu() );
				InputBestScoreCreate( pEntClicked->GetParent()->GetParent() );
			}
			else
			{
				tetris->ResetEndGame();

				GameState::SetState( new GS_Menu() );
				MainMenuCreate( pEntClicked->GetParent()->GetParent() );
			}
		
			tetris->FreeInstance();
			config->FreeInstance();

			return;
		}

		GameState::SetState( new GS_Menu() );

		if( config->getMusic() )
		{
			GetAudioManager()->StopMusic();
		}
		
		GetApp()->setGame( false );
		SlideScreen( pEntClicked->GetParent(), false );
		GetMessageManager()->CallEntityFunction( pEntClicked->GetParent(), 500, "OnDelete", NULL );
		MainMenuCreate( pEntClicked->GetParent()->GetParent() );
	}

	if( pEntClicked->GetName() == GUI_IMAGEBUTTON_GAMEPLAY_DOWN && !tetris->isEndGame() )
	{
		if( config->getSoundEffects() )
		{
			GetAudioManager()->Play( GetApp()->getResourceInstance()->getItem(GetApp()->getResolutionType(), RES_TYPE_AUDIO, RES_ID_AUDIO_FIGURE_DOWN ) );
		}
		tetris->ClickForceDown();
	}

	if( pEntClicked->GetName() == GUI_IMAGEBUTTON_GAMEPLAY_LEFT && !tetris->isEndGame() )
	{
		buttonMoveSound();
		tetris->ClickLeft();
	}

	if( pEntClicked->GetName() == GUI_IMAGEBUTTON_GAMEPLAY_RIGHT && !tetris->isEndGame() )
	{
		buttonMoveSound();
		tetris->ClickRight();
	}

	if( pEntClicked->GetName() == GUI_IMAGEBUTTON_GAMEPLAY_ROTATE && !tetris->isEndGame() )
	{
		buttonMoveSound();
		tetris->ClickRotate();
	}

	tetris->FreeInstance();
	config->FreeInstance();
}
开发者ID:maximbilan,项目名称:tblock,代码行数:81,代码来源:GUI_Game.cpp


示例19: HtmlHelpA

HWND CWnd::HtmlHelp(UINT uCommand,DWORD_PTR dwData,LPCSTR szHelpFile)
{
	if (szHelpFile!=NULL)
	{	
		if (FirstCharIndex(szHelpFile,'\\')!=-1)
			return HtmlHelpA(m_hWnd,szHelpFile,uCommand,dwData);


		// Insert path
#ifdef DEF_WCHAR
		if (IsUnicodeSystem())
		{
			CStringW sExeName=GetApp()->GetExeNameW();
			return HtmlHelpW(*this,sExeName.Left(sExeName.FindLast(L'\\')+1)+szHelpFile,
				uCommand,dwData);
		}
#endif
	
		CString sExeName=GetApp()->GetExeName();
		return HtmlHelpA(*this,sExeName.Left(sExeName.FindLast(L'\\')+1)+szHelpFile,
			uCommand,dwData);
	}

	
#ifdef DEF_WCHAR
	LPCWSTR szwHelpFile=GetApp()->m_szHelpFile;
	if (szwHelpFile!=NULL)
	{	
		if (FirstCharIndex(szwHelpFile,L'\\')!=-1)
		{
			if (IsUnicodeSystem())
				return HtmlHelpW(m_hWnd,szwHelpFile,uCommand,dwData);
			else
				return HtmlHelpA(m_hWnd,W2A(szwHelpFile),uCommand,dwData);
		}

		// Insert path
		if (IsUnicodeSystem())
		{
			CStringW sExeName=GetApp()->GetExeNameW();
			return HtmlHelpW(*this,sExeName.Left(sExeName.FindLast(L'\\')+1)+szwHelpFile,
				uCommand,dwData);
		}
	
		CString sExeName=GetApp()->GetExeName();
		return HtmlHelpA(*this,sExeName.Left(sExeName.FindLast(L'\\')+1)+szwHelpFile,
			uCommand,dwData);
	}

	if (IsUnicodeSystem())
	{
		CStringW sExeName=GetApp()->GetExeNameW();
		return HtmlHelpW(*this,sExeName.Left(sExeName.FindLast(L'.')+1)+L"chm",
			uCommand,dwData);
	}
#endif

	CString sExeName=GetApp()->GetExeName();
	return HtmlHelpA(*this,sExeName.Left(sExeName.FindLast(L'.')+1)+"chm",
		uCommand,dwData);
}
开发者ID:eladkarako,项目名称:locate32,代码行数:61,代码来源:WindowClasses.cpp


示例20: remove

bool remove( dp::sg::core::ObjectSharedPtr const& parent, dp::sg::core::ObjectSharedPtr const& child )
{
  switch( parent->getObjectCode() )
  {
    case dp::sg::core::OC_GEONODE :
      if ( child.isPtrTo<dp::sg::core::EffectData>() )
      {
        parent.staticCast<dp::sg::core::GeoNode>()->setMaterialEffect( dp::sg::core::EffectDataSharedPtr() );
      }
      else
      {
        DP_ASSERT( child.isPtrTo<dp::sg::core::Primitive>() );
        parent.staticCast<dp::sg::core::GeoNode>()->setPrimitive( dp::sg::core::PrimitiveSharedPtr() );
      }
      break;
    case dp::sg::core::OC_GROUP :
    case dp::sg::core::OC_LOD :
    case dp::sg::core::OC_SWITCH :
    case dp::sg::core::OC_TRANSFORM :
    case dp::sg::core::OC_BILLBOARD :
      if ( child.isPtrTo<dp::sg::core::Node>() )
      {
        parent.staticCast<dp::sg::core::Group>()->removeChild( child.staticCast<dp::sg::core::Node>() );
      }
      else
      {
        DP_ASSERT( child.isPtrTo<dp::sg::core::ClipPlane>() );
        parent.staticCast<dp::sg::core::Group>()->removeClipPlane( child.staticCast<dp::sg::core::ClipPlane>() );
      }
      break;
    case dp::sg::core::OC_PRIMITIVE :
      if ( child.isPtrTo<dp::sg::core::IndexSet>() )
      {
        parent.staticCast<dp::sg::core::Primitive>()->setIndexSet( dp::sg::core::IndexSetSharedPtr() );
      }
      else
      {
        DP_ASSERT( child.isPtrTo<dp::sg::core::VertexAttributeSet>() );
        parent.staticCast<dp::sg::core::Primitive>()->setVertexAttributeSet( dp::sg::core::VertexAttributeSetSharedPtr() );
      }
      break;
    case dp::sg::core::OC_EFFECT_DATA :
      DP_ASSERT( child.isPtrTo<dp::sg::core::ParameterGroupData>() );
      {
        dp::sg::core::ParameterGroupDataSharedPtr const& pgd = child.staticCast<dp::sg::core::ParameterGroupData>();
        dp::sg::core::EffectDataSharedPtr const& ed = parent.staticCast<dp::sg::core::EffectData>();
        dp::fx::SmartEffectSpec const & es = ed->getEffectSpec();
        DP_ASSERT( es->findParameterGroupSpec( pgd->getParameterGroupSpec() ) != es->endParameterGroupSpecs() );
        parent.staticCast<dp::sg::core::EffectData>()->setParameterGroupData( es->findParameterGroupSpec( pgd->getParameterGroupSpec() ), dp::sg::core::ParameterGroupDataSharedPtr() );
      }
      break;
    case dp::sg::core::OC_PARAMETER_GROUP_DATA :
      DP_ASSERT( child->getObjectCode() == dp::sg::core::OC_SAMPLER );
      {
        dp::sg::core::ParameterGroupDataSharedPtr const& pgd = parent.staticCast<dp::sg::core::ParameterGroupData>();
        const dp::fx::SmartParameterGroupSpec & pgs = pgd->getParameterGroupSpec();
        dp::fx::ParameterGroupSpec::iterator it = pgs->findParameterSpec( child.staticCast<dp::sg::core::Sampler>()->getName() );
        DP_ASSERT( it != pgs->endParameterSpecs() );
        pgd->setParameter( it, dp::sg::core::SamplerSharedPtr() );
      }
      break;
    case dp::sg::core::OC_PARALLELCAMERA :
    case dp::sg::core::OC_PERSPECTIVECAMERA :
    case dp::sg::core::OC_MATRIXCAMERA :
      DP_ASSERT( child->getObjectCode() == dp::sg::core::OC_LIGHT_SOURCE );
      parent.staticCast<dp::sg::core::Camera>()->removeHeadLight( child.staticCast<dp::sg::core::LightSource>() );
      break;
    case dp::sg::core::OC_SCENE :
      if ( child.isPtrTo<dp::sg::core::Camera>() )
      {
        DP_VERIFY( parent.staticCast<dp::sg::core::Scene>()->removeCamera( child.staticCast<dp::sg::core::Camera>() ) );
      }
      else
      {
        DP_ASSERT( child.isPtrTo<dp::sg::core::Node>() );
        parent.staticCast<dp::sg::core::Scene>()->setRootNode( dp::sg::core::NodeSharedPtr() );
      }
      break;
    default :
      DP_ASSERT( false );
      break;
  }

  GetApp()->outputStatistics();

  return true;
}
开发者ID:getov,项目名称:pipeline,代码行数:87,代码来源:CommandAddItem.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetAppClass函数代码示例发布时间:2022-05-30
下一篇:
C++ GetAngle函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap