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


C++ CString::GetString方法代码示例

本文整理汇总了C++中CString::GetString方法的典型用法代码示例。如果您正苦于以下问题:C++ CString::GetString方法的具体用法?C++ CString::GetString怎么用?C++ CString::GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CString的用法示例。


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

示例1: ClearFile

int KJxUpdaterDlg::ClearFile(const CString &strPath)
{
	int nRetCode = FALSE;
	CString strPathName;
	CString strFullPathFile;
	CString strFile;
	WIN32_FIND_DATA FindFileData;
	HANDLE hFindFile  = NULL;

	strPathName = strPath + _T("*.*");

	hFindFile = FindFirstFile(strPathName.GetString(), &FindFileData);
	if (hFindFile != INVALID_HANDLE_VALUE)
	{
		while (true)
		{
			strFile = FindFileData.cFileName;
			if (
				(strFile != _T(".")) &&
				(strFile != _T(".."))
				)
			{
				strFullPathFile = strPath + strFile;
				if (!(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
				{
					_tremove(strFullPathFile.GetString());
				}
				else
				{
					strFullPathFile += _T("\\");
					ClearFile(strFullPathFile);
				}
			}

			nRetCode = FindNextFile(hFindFile, &FindFileData);
			if (!nRetCode)
			{
				if (GetLastError() == ERROR_NO_MORE_FILES)
					break;
			}
		}
	}

	return TRUE;
}
开发者ID:viticm,项目名称:pap2,代码行数:45,代码来源:JxUpdaterDlg.cpp

示例2: SetPaneString

 void SetPaneString(int nIndext,CString str)
{

	CMFCStatusBar * pStatusBar=NULL;
	if(AfxGetMainWnd()->GetActiveWindow()==NULL)//if this function is called by a thread ,return 
		return;
	pStatusBar = (CMFCStatusBar *) AfxGetMainWnd()->GetDescendantWindow(AFX_IDW_STATUS_BAR);
	pStatusBar->SetPaneText(nIndext,str.GetString());
}
开发者ID:Fance,项目名称:T3000_Building_Automation_System,代码行数:9,代码来源:global_function.cpp

示例3: getFullRecordingPathForImageType

CString ImageRecordingConfiguration::getFullRecordingPathForImageType(ImageRecordType imageType, CString outputFolder, CString timeStampFolderName)
{
	CString subFolder = getSubFolderNameForImageType(imageType);
	CString fullPath;

	fullPath += outputFolder.GetString();
	auto outputEnding = fullPath.Right(1);
	if (outputEnding != L"\\"){
		fullPath += _T("\\");
	}
	fullPath += timeStampFolderName.GetString();
	outputEnding = fullPath.Right(1);
	if (outputEnding != L"\\"){
		fullPath += _T("\\");
	}
	fullPath += subFolder;
	return fullPath;
}
开发者ID:sudutgalau,项目名称:FaceGrabber,代码行数:18,代码来源:ImageRecordingconfiguration.cpp

示例4: OnEnChangeSequencename

void GcEditorSequenceMain::OnEnChangeSequencename()
{
	CString strTemp;	
	mEtSequenceName.GetWindowText( strTemp );

	GtConvertString strName = strTemp.GetString();
	mpSequence->SetObjectName( strName.GetAciiString() );
	CheckEnableOKButton();
}
开发者ID:issamux,项目名称:WebGame,代码行数:9,代码来源:GcEditorSequenceMain.cpp

示例5: OnBnClickedOk

void CRtsSettingsDlg::OnBnClickedOk()
{
	regHandler.SetInt("TreeRadius",TreeDist.GetPos());
	regHandler.SetInt("GroundDetail",TerrainLod.GetPos());
	regHandler.SetInt("UnitLodDist",UnitLodDist.GetPos());
	regHandler.SetInt("UnitIconDist", UnitIconDist.GetPos());
	regHandler.SetInt("SM3MaxTextureStages", Sm3MaxTextureStages.GetPos());
	regHandler.SetInt("GrassDetail",GrassDetail.GetPos());
	regHandler.SetInt("MaxParticles",Particles.GetPos());
	regHandler.SetInt("ShadowMapSize",shadowMapSize.GetPos()*1024);
	regHandler.SetInt("MaxSounds",maxSounds.GetPos());
	regHandler.SetInt("GroundDecals",GroundDecals.GetPos());
	regHandler.SetInt("VerboseLevel",VerboseLevel.GetPos());
	regHandler.SetInt("SoundVolume",SoundVolume.GetPos());
	regHandler.SetInt("UnitReplySoundVolume",UnitReplySoundVolume.GetPos());

	char text[500];
	xres.GetWindowText(text,500);
	regHandler.SetInt("XResolution",atoi(text));
	yres.GetWindowText(text,500);
	regHandler.SetInt("YResolution",atoi(text));

	regHandler.SetInt("3DTrees",AdvTree.GetCheck());
	regHandler.SetInt("AdvSky",AdvCloud.GetCheck());
	regHandler.SetInt("DynamicSky",DynCloud.GetCheck());
	regHandler.SetInt("Fullscreen",Fullscreen.GetCheck());
	regHandler.SetInt("ColorElev",ColorElev.GetCheck());
	regHandler.SetInt("Shadows",shadows.GetCheck());
	regHandler.SetInt("SimpleMiniMapColors",simpleColors.GetCheck());
	regHandler.SetInt("CatchAIExceptions",CatchAIExceptions.GetCheck());
	regHandler.SetInt("AdvUnitShading",AdvUnitRendering.GetCheck());
	regHandler.SetInt("SM3ForceFallbackTex", Sm3ForceFallbackTex.GetCheck());
	regHandler.SetInt("VSync", vsync.GetCheck());
	regHandler.SetInt("DepthBufferBits", zbits16.GetCheck() ? 16 : 24);

	int fsaaLevel=FSAASamples.GetPos();
	if (fsaaLevel>1) {
		regHandler.SetInt("FSAALevel", fsaaLevel);
		regHandler.SetInt("FSAA", 1);
	} else
		regHandler.SetInt("FSAA", 0);

	if(Water2.GetCheck())
		regHandler.SetInt("ReflectiveWater",2);
	if(Water1.GetCheck())
		regHandler.SetInt("ReflectiveWater",1);
	if(Water0.GetCheck())
		regHandler.SetInt("ReflectiveWater",0);
	if(Water3.GetCheck())
		regHandler.SetInt("ReflectiveWater",3);

	CString s;
	PlayerName.GetWindowText(s);
	regHandler.SetString("name",s.GetString());

	OnOK();
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:57,代码来源:RtsSettingsDlg.cpp

示例6: OnInsertString

LRESULT CDlgAutoRegister::OnInsertString( WPARAM wParam, LPARAM lParam )
{
	//LPCTSTR lpString = (LPCTSTR)wParam;
	//m_listBox.InsertString(0, lpString);
	CString* pStr = (CString*)wParam;
	m_listBox.InsertString(0, pStr->GetString());
	delete pStr;
	return 0;
}
开发者ID:layerfsd,项目名称:PersonalIBA,代码行数:9,代码来源:DlgAutoRegister.cpp

示例7: GetAppFullPath

CString Utils::GetAppFullPath(void)
{
	static CString s_appFullPath;
	if (s_appFullPath.IsEmpty())
	{
		s_appFullPath.ReleaseBufferSetLength(::GetModuleFileName(NULL, s_appFullPath.GetBuffer(MAX_PATH), MAX_PATH));
	}
	return s_appFullPath.GetString();
}
开发者ID:wang1986one,项目名称:duipcmgr,代码行数:9,代码来源:FileUtil.cpp

示例8: OnBnClickedOk

void CDlgChairNum::OnBnClickedOk()
{
	CString text;

	m_ChairNum.GetWindowText(text);
	chair = strtoul(text.GetString(), NULL, 10);

	OnOK();
}
开发者ID:ohzooboy,项目名称:oh,代码行数:9,代码来源:DialogChairNum.cpp

示例9: process_to_start

void CProject3Dlg::OnBnClickedButtonStartConsole()
{
	CString text;
	m_eDllLoadsN.GetWindowTextW(text);
	if (text.IsEmpty())
		return;
	int dll_loads_count = std::stoi(text.GetString());
	m_eObjectsN.GetWindowTextW(text);
	if (text.IsEmpty())
		return;
	int obj_count = std::stoi(text.GetString());

	std::wstring process_to_start(L"Project2.exe");
	std::wstring args = std::to_wstring(dll_loads_count) + L" " + std::to_wstring(obj_count) + L" " + std::to_wstring((int)m_hWnd);

	SHELLEXECUTEINFO shellExInfo;
	shellExInfo.cbSize = sizeof(SHELLEXECUTEINFO);
	shellExInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
	shellExInfo.hwnd = NULL;
	shellExInfo.lpVerb = L"open";
	shellExInfo.lpFile = process_to_start.c_str();
	shellExInfo.lpParameters = args.c_str();
	shellExInfo.lpDirectory = L".\\";
	shellExInfo.nShow = SW_SHOW;
	shellExInfo.hInstApp = NULL;

	// start process
	if (!ShellExecuteEx(&shellExInfo)) {
		MessageBox(_T("Can't start console"), _T("Error"), NULL);
		return;
	}

	// retrieve PID
	if (!GetProcessId(shellExInfo.hProcess)) {
		MessageBox(_T("Error while GetProcessId()"), _T("Error"), NULL);
		return;
	}
	m_hConsoleProcess = shellExInfo.hProcess;

	ConsoleThreadProcData* data = new ConsoleThreadProcData();
	data->m_hConsoleProcess = m_hConsoleProcess;
	data->m_hWnd = m_hWnd;
	AfxBeginThread(ConsoleThreadProc, data);
}
开发者ID:prohor33,项目名称:test-dll-console,代码行数:44,代码来源:Project3Dlg.cpp

示例10: RunAsync

int CGit::RunAsync(CString cmd,PROCESS_INFORMATION *piOut,HANDLE *hReadOut,CString *StdioFile)
{
	SECURITY_ATTRIBUTES sa;
	HANDLE hRead, hWrite;
	HANDLE hStdioFile = NULL;

	sa.nLength = sizeof(SECURITY_ATTRIBUTES);
	sa.lpSecurityDescriptor=NULL;
	sa.bInheritHandle=TRUE;
	if(!CreatePipe(&hRead,&hWrite,&sa,0))
	{
		return GIT_ERROR_OPEN_PIP;
	}
	
	if(StdioFile)
	{
		hStdioFile=CreateFile(*StdioFile,GENERIC_WRITE,FILE_SHARE_READ   |   FILE_SHARE_WRITE,   
			&sa,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);  
	}

	STARTUPINFO si;
	PROCESS_INFORMATION pi;
	si.cb=sizeof(STARTUPINFO);
	GetStartupInfo(&si);

	si.hStdError=hWrite;
	if(StdioFile)
		si.hStdOutput=hStdioFile;
	else
		si.hStdOutput=hWrite;

	si.wShowWindow=SW_HIDE;
	si.dwFlags=STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;

	LPTSTR pEnv = l_processEnv;
	DWORD dwFlags = pEnv ? CREATE_UNICODE_ENVIRONMENT : 0;

	if(!CreateProcess(NULL,(LPWSTR)cmd.GetString(), NULL,NULL,TRUE,dwFlags,pEnv,(LPWSTR)m_CurrentDir.GetString(),&si,&pi))
	{
		LPVOID lpMsgBuf;
		FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
			NULL,GetLastError(),MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
			(LPTSTR)&lpMsgBuf,
			0,NULL);
		return GIT_ERROR_CREATE_PROCESS;
	}
	
	CloseHandle(hWrite);
	if(piOut)
		*piOut=pi;
	if(hReadOut)
		*hReadOut=hRead;
	
	return 0;

}
开发者ID:jrk,项目名称:tortoisegit,代码行数:56,代码来源:Git.cpp

示例11: OnRealNameMsg

INT CRealNameBase::OnRealNameMsg(UINT nMsgType, LPVOID lpData /*= NULL*/, DWORD dwLen /*= 0*/)
{
	UNIT_TRACE("CRealNameBase::OnRealNameMsg(...)");

	if (DoHasLocalRealName(nMsgType, lpData, dwLen))
	{
		return -1;
	}

	if (99 == nMsgType) //自定义
	{
		if (lpData != NULL)
		{
			CString* pStr = (CString*)lpData;

			CheckCard(pStr->GetString());

			if (m_nMemberId > 0)
			{
				m_NetBarUser.SetMemberId(m_nMemberId);

				// 2011/05/17-gxx: 
				m_NetBarUser.SetNetId(*pStr);

				QueryBalance();
				OnOldUser(m_NetBarUser);
			}
		}
	}
	else if (999 == nMsgType)
	{
		ReadUserInfo(m_NetBarUser);

		m_NetBarUser.GetNetId();

		if (!CheckCard(m_NetBarUser.GetNetId()))
		{
			return 0;
		}

		if (m_nMemberId > 0) //老卡,先激活
		{
			m_NetBarUser.SetMemberId(m_nMemberId);

			QueryBalance();

			OnOldUser(m_NetBarUser);
		}
		else //新卡,计费未注册
		{
			OnNewUser(m_NetBarUser);
		}
	}

	return 0;
}
开发者ID:layerfsd,项目名称:PersonalIBA,代码行数:56,代码来源:RealNameBase.cpp

示例12: DisConnectServ

void CHawkeye_clientApp::DisConnectServ()
{
	CString dtime;
	_wstrtime((TCHAR*)dtime.GetString());
	phe->m_listlog.InsertItem(0,dtime);
	phe->m_listlog.SetItemText(0,1,L"NETWORK");
	phe->m_listlog.SetItemText(0,2,L"Disconnected");
	phe->m_listlog.UpdateData(false);
	isConnect = false;
}
开发者ID:MikaAriel,项目名称:Hawkeye_client,代码行数:10,代码来源:Hawkeye_client.cpp

示例13:

CVSFilterApp::CVSFilterApp()
{
#ifdef __DO_LOG
    LPTSTR  strDLLPath = new TCHAR[_MAX_PATH];
    ::GetModuleFileName(reinterpret_cast<HINSTANCE>(&__ImageBase), strDLLPath, _MAX_PATH);
    CString dllPath = strDLLPath;
    dllPath += ".properties";
    xy_logger::doConfigure(dllPath.GetString());
#endif
}
开发者ID:kenygia,项目名称:xy-vsfilter,代码行数:10,代码来源:VSFilter.cpp

示例14: OnReloadScript

void CDataPool::OnReloadScript()
{
	//加载全局函数
	char szExePath[MAX_PATH];
	GetModuleFileName(NULL, szExePath,MAX_PATH);
	std::string ss = szExePath;
	CString szScriptPath = ss.substr(0,ss.find_last_of('\\')).c_str();
	szScriptPath += "/editor_global.lua";
	m_scriptModule.DoFile(szScriptPath.GetString());
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:10,代码来源:DataPool.cpp

示例15: UpdateImageList

void CWndImageList::UpdateImageList()
{
	SQRWnd* pEditWnd = m_pWndGroup->GetEditWnd();
	if( pEditWnd == NULL )
		return;

	IMAGE_PARAM IP ( SM_BS_BK, m_nImageType );	
	WND_IMAGE_LIST* pImageList = pEditWnd->GetWndBkImage( IP );
	if( pImageList == NULL )
		return;

	m_pWndGroup->Check();
	int n1 = GetItemCount();
	int n2 = pImageList->GetImageCount();
	for( int i = 0; i < GetItemCount(); i++ )
	{
		IMAGE& Image = pImageList->GetImage( i );
		CString szImageName = Image.pTexture ? gbk_to_utf16(Image.pTexture->GetName()).c_str() : L"";
		CString itemText = GetItemText(i, 0);
		if(itemText == szImageName )
			continue;
		Image.dwColor = 0xffffffff;
		SafeRelease( Image.pTexture );
		HRESULT hr = pEditWnd->GetGraphic()->CreateTexture( L"", utf16_to_gbk(itemText.GetString() ).c_str(), &Image.pTexture);
		if (FAILED(hr))
			OutputDebugString(itemText);

		if ( Image.pTexture )
		{
			Image.texName = utf16_to_gbk(itemText.GetString() ).c_str();
		}
		// 对于 tree 和 list 需要即时更新
		if ( pEditWnd->GetClassName() == string( "CListCtrl" ))
		{
			SQRListCtrl* pListCtrl = (SQRListCtrl*)pEditWnd;
			pListCtrl->UpdateItemImage();
		}
	}
	IMAGE& Image = pImageList->GetImage( m_nEditItem );
	m_ImageProp->ResetImageProp( &Image, m_pWndGroup );
	m_pWndGroup->ReCheck();
}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:42,代码来源:CWndImageList.cpp


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