當前位置: 首頁>>代碼示例>>C++>>正文


C++ CStringA函數代碼示例

本文整理匯總了C++中CStringA函數的典型用法代碼示例。如果您正苦於以下問題:C++ CStringA函數的具體用法?C++ CStringA怎麽用?C++ CStringA使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CStringA函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: CStringA

//-----  OnBnClickedBtViewColl()  ---------------------------------------------
void CFormChunkMergeView::OnBnClickedBtViewColl()
{
	// TODO: Add your control notification handler code here

	//  switch to form ModelView
	theApp.m_pMainWnd->PostMessage(WM_COMMAND, ID_TOOLS_MODELVIEWER);

	//  load model
	((CNifUtilsSuiteFrame*) theApp.m_pMainWnd)->BroadcastEvent(IBCE_SHOW_MODEL, (void*) CStringA(_fileNameColl).GetString());
}
開發者ID:skyfox69,項目名稱:NifUtilsSuite,代碼行數:11,代碼來源:FormChunkMergeView.cpp

示例2: OnBnClickedOk

void CMissedCallsDlg::OnBnClickedOk()
{
	// TODO: Add your control notification handler code here
	CppSQLite3DB db;
	db.open(CStringA(OUTCALL_DB));
	try {
		db.execDML("update MissedCalls set NewCall=0 where NewCall=2");
	} catch (CppSQLite3Exception& e) { }

	OnOK();
}
開發者ID:bicomsystems,項目名稱:outcall,代碼行數:11,代碼來源:MissedCallsDlg.cpp

示例3: OnCancel

void CMissedCallsDlg::OnCancel()
{
	CppSQLite3DB db;
	db.open(CStringA(OUTCALL_DB));

	try {
		db.execDML("update MissedCalls set NewCall=0 where NewCall=2");	
	} catch (CppSQLite3Exception& e) { }

	CDialog::OnCancel();
}
開發者ID:bicomsystems,項目名稱:outcall,代碼行數:11,代碼來源:MissedCallsDlg.cpp

示例4: String2Bin

void String2Bin(CString str, CByteArray *res)
{
	res->RemoveAll();
	int k=str.GetLength();
	CStringA rab;
	for(int i=0;i<str.GetLength();i+=2) {
		rab = CStringA(str.Mid(i,2));
		char *p = NULL;
		unsigned long bin = strtoul(rab.GetBuffer(), &p, 16);
		res->Add(bin);
	}
}
開發者ID:iostrovs,項目名稱:microsip-modified,代碼行數:12,代碼來源:global.cpp

示例5: CStringA

CStringA CUnicodeUtils::GetUTF8(const CStringA& string)
{
	WCHAR * buf;
	int len = string.GetLength();
	if (len==0)
		return CStringA();
	buf = new WCHAR[len*4 + 1];
	int lengthIncTerminator = MultiByteToWideChar(CP_ACP, 0, string, -1, buf, len * 4);
	CStringW temp = CStringW(buf, lengthIncTerminator - 1);
	delete [] buf;
	return (CUnicodeUtils::GetUTF8(temp));
}
開發者ID:tribis,項目名稱:TortoiseGit,代碼行數:12,代碼來源:UnicodeUtils.cpp

示例6: GetDlgItemText

void CInsertDlg::save()
{
	ImageInfo item = album.record(fileno[cur]);
	ImageInfo newitem = item;
	string m[] = { "中國", "華師大", "null" };
	CString s;
	GetDlgItemText(IDC_EDIT2, s);
	newitem.set_textcn(string(CStringA(s)));
	GetDlgItemText(IDC_EDIT3, s);
	newitem.set_texten(string(CStringA(s)));
	GetDlgItemText(IDC_EDIT4, s);
	newitem.set_postion(string(CStringA(s)));
	GetDlgItemText(IDC_EDIT5, s);
	newitem.set_posl(string(CStringA(s)));
	GetDlgItemText(IDC_EDIT6, s);
	newitem.set_lname(string(CStringA(s)));
	GetDlgItemText(IDC_EDIT7, s);
	newitem.set_uper(string(CStringA(s)));

	int radio = GetCheckedRadioButton(IDC_RADIO_1, IDC_RADIO_3) - IDC_RADIO_1;
	newitem.set_map(m[radio]);
	item = newitem;
	album.update(item, newitem);
	init();
}
開發者ID:KaitoHH,項目名稱:iPhotoBookManager,代碼行數:25,代碼來源:InsertDlg.cpp

示例7: CStringA

bool CDBAdo::CheckStation(string totalStr[],CString currentStr, CString &lastStr)
{
	string strCurrent;
	strCurrent = CStringA(currentStr);

	for (int i=0; i<32; i++)
	{
		if (strstr(totalStr[i].c_str(),strCurrent.c_str()))
		{
			if (i == 0)
			{
				return false;
			}
			else
			{
				for (int k=0; k<32; k++)
				{
					if (strstr(totalStr[i-1].c_str(),"二維碼"))
					{
						lastStr = L"打印二維碼界麵";
					}
					else if (strstr(totalStr[i-1].c_str(),"功能"))
					{
						lastStr = L"功能測試界麵";
					}
					else if (strstr(totalStr[i-1].c_str(),"OQC"))
					{
						lastStr = L"OQC界麵";
					}
					else if (strstr(totalStr[i-1].c_str(),"PalletID"))
					{
						lastStr = L"PalletID界麵";
					}
					else if (strstr(totalStr[i-1].c_str(),"出貨"))
					{
						lastStr = L"出貨界麵";
					}
					else if (strstr(totalStr[i-1].c_str(),"激活"))
					{
						lastStr = L"激活界麵";
					}
				}
				break;
			}
		}
	}
	if (lastStr.GetLength() <= 0)
	{
		return false;
	}
	return true;
}
開發者ID:HanoiGuo,項目名稱:BoJay-SFIS,代碼行數:52,代碼來源:DBAdo.cpp

示例8: m_pD3DXCompileShader

HRESULT CPixelShaderCompiler::CompileShader(
    LPCSTR pSrcData,
    LPCSTR pFunctionName,
    LPCSTR pProfile,
    DWORD Flags,
    IDirect3DPixelShader9** ppPixelShader,
    CString* disasm,
    CString* errmsg)
{
    if (!m_pD3DXCompileShader || !m_pD3DXDisassembleShader) {
        return E_FAIL;
    }

    HRESULT hr;

    CComPtr<ID3DXBuffer> pShader, pDisAsm, pErrorMsgs;
    hr = m_pD3DXCompileShader(pSrcData, (UINT)strlen(pSrcData), NULL, NULL, pFunctionName, pProfile, Flags, &pShader, &pErrorMsgs, NULL);

    if (FAILED(hr)) {
        if (errmsg) {
            CStringA msg = "Unexpected compiler error";

            if (pErrorMsgs) {
                int len = pErrorMsgs->GetBufferSize();
                memcpy(msg.GetBufferSetLength(len), pErrorMsgs->GetBufferPointer(), len);
            }

            *errmsg = msg;
        }

        return hr;
    }

    if (ppPixelShader) {
        if (!m_pD3DDev) {
            return E_FAIL;
        }
        hr = m_pD3DDev->CreatePixelShader((DWORD*)pShader->GetBufferPointer(), ppPixelShader);
        if (FAILED(hr)) {
            return hr;
        }
    }

    if (disasm) {
        hr = m_pD3DXDisassembleShader((DWORD*)pShader->GetBufferPointer(), FALSE, NULL, &pDisAsm);
        if (SUCCEEDED(hr) && pDisAsm) {
            *disasm = CStringA((const char*)pDisAsm->GetBufferPointer());
        }
    }

    return S_OK;
}
開發者ID:AeonAxan,項目名稱:mpc-hc,代碼行數:52,代碼來源:PixelShaderCompiler.cpp

示例9: _T

void CSettingDlg::OnBnClickedButtonPath()
{
	// 在此添加控件通知處理程序代碼
	TCHAR szFilter[] = _T("圖片文件(*.jpg;*.jpeg;*.bmp;*.png)|*.jpg;*.jpeg;*.bmp;*.png||");
	CFileDialog fileDlg(true, NULL, NULL, 0, szFilter, this);
	CString strFilePath;
	if (IDOK == fileDlg.DoModal()){
		strFilePath = fileDlg.GetPathName();
		CStatic *m_pic = (CStatic *)GetDlgItem(IDC_IMAGE);
		show_avator(strFilePath, m_pic);
		setting.avatorpath = CStringA(strFilePath);
	}
}
開發者ID:KaitoHH,項目名稱:iPhotoBookManager,代碼行數:13,代碼來源:SettingDlg.cpp

示例10: strncpy_s

CStringA ISOLang::ISO6391To6392(LPCSTR code)
{
    CHAR tmp[2 + 1];
    strncpy_s(tmp, code, 2);
    tmp[2] = 0;
    _strlwr_s(tmp);
    for (size_t i = 0, cnt = _countof(s_isolangs); i < cnt; i++) {
        if (!strcmp(s_isolangs[i].iso6391, tmp)) {
            return CStringA(s_isolangs[i].iso6392);
        }
    }
    return "";
}
開發者ID:Blitzker,項目名稱:mpc-hc,代碼行數:13,代碼來源:ISOLang.cpp

示例11: pConfig

//-----  OnBnClickedBtPathNifxml()  -------------------------------------------
void COptionsPageGeneral::OnBnClickedBtPathNifxml()
{
	Configuration*	pConfig(Configuration::getInstance());

	UpdateData(TRUE);
	_pathNifXML = FDFileHelper::getFile(_pathNifXML, _T("Nif-XML (nif.xml)|nif.xml||"), _T("xml"), false, _T("Please select Nif.xml file"), OFN_FILEMUSTEXIST);
	UpdateData(FALSE);
	m_ToolTip.AddTool(GetDlgItem(IDC_ED_PATH_NIFXML), _pathNifXML);

	//  re-initialize material list
	delete NifUtlMaterialList::getInstance();
	NifUtlMaterialList::initInstance(CStringA(_pathNifXML).GetString(), pConfig->_matScanTag, pConfig->_matScanName);
}
開發者ID:skyfox69,項目名稱:NifUtilsSuite,代碼行數:14,代碼來源:OptionsPageGeneral.cpp

示例12: CString

void CPPageFormats::AddAutoPlayToRegistry(autoplay_t ap, bool fRegister)
{
	TCHAR buff[_MAX_PATH];
	if (::GetModuleFileName(AfxGetInstanceHandle(), buff, _MAX_PATH) == 0) {
		return;
	}
	CString exe = buff;

	int i = (int)ap;
	if (i < 0 || i >= countof(handlers)) {
		return;
	}

	CRegKey key;

	if (fRegister) {
		if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, _T("MediaPlayerClassic.Autorun"))) {
			return;
		}
		key.Close();

		if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT,
										CString(CStringA("MediaPlayerClassic.Autorun\\Shell\\Play") + handlers[i].verb + "\\Command"))) {
			return;
		}
		key.SetStringValue(NULL, _T("\"") + exe + _T("\"") + handlers[i].cmd);
		key.Close();

		if (ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE,
										CString(CStringA("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\AutoplayHandlers\\Handlers\\MPCPlay") + handlers[i].verb + "OnArrival"))) {
			return;
		}
		key.SetStringValue(_T("Action"), ResStr(handlers[i].action));
		key.SetStringValue(_T("Provider"), _T("Media Player Classic"));
		key.SetStringValue(_T("InvokeProgID"), _T("MediaPlayerClassic.Autorun"));
		key.SetStringValue(_T("InvokeVerb"), CString(CStringA("Play") + handlers[i].verb));
		key.SetStringValue(_T("DefaultIcon"), exe + _T(",0"));
		key.Close();

		if (ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE,
										CString(CStringA("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\AutoplayHandlers\\EventHandlers\\Play") + handlers[i].verb + "OnArrival"))) {
			return;
		}
		key.SetStringValue(CString(CStringA("MPCPlay") + handlers[i].verb + "OnArrival"), _T(""));
		key.Close();
	} else {
		if (ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE,
										CString(CStringA("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\AutoplayHandlers\\EventHandlers\\Play") + handlers[i].verb + "OnArrival"))) {
			return;
		}
		key.DeleteValue(CString(CStringA("MPCPlay") + handlers[i].verb + "OnArrival"));
		key.Close();
	}
}
開發者ID:Samangan,項目名稱:mpc-hc,代碼行數:54,代碼來源:PPageFormats.cpp

示例13: CTrace

CControl::CControl()
{
	m_ControlState = NO_INICIADO;

	m_Traces = new CTrace();
	m_cfgProxy = CConfigProxy::GetInstance();

	m_numClientSockets = 12 + (10 * m_cfgProxy->getTunersNumber());
	m_clientSockets = new InfoClientSocket[m_numClientSockets];

	wdControlErr = 0;
	wdControlErr_Count = 10;
	
	m_clientSocket = 0; //Current socket
	m_NumMsg = 0;

	m_HDHRClientIP = new char[16];
	strcpy(m_HDHRClientIP, "");
	m_HDHRClientPort = 0;
	strcpy(m_location, CStringA(m_cfgProxy->lineup_location));
	m_libHDHR.setLocation(m_location);

	m_numTuners = m_cfgProxy->getTunersNumber();

	//Initilize Tuners
	m_infoTuners = new CTuner[m_numTuners];

	for (int i = 0; i < m_numTuners; i++)
	{
		m_infoTuners[i].setTuner(i);
		m_infoTuners[i].transportTuner->setTuner(i);
	}

	//Initialization structure for the treatment of messages HDHR
	m_infoMsg = new InfoMessageHDHR;
	m_infoMsg->tipoMsg = ERROR_MSG;
	m_infoMsg->setMsg = 0;
	m_infoMsg->RequestMsg = new char[50];
	m_infoMsg->peticionMsg = new char[50];
	m_infoMsg->setValue = (char*)malloc(200);
	strcpy(m_infoMsg->setValue, "");
	strcpy(m_infoMsg->unknownMsg, "");
	m_infoMsg->numTuner = 0;
	m_infoMsg->seqUpgrade = 0;
	m_infoMsg->upgradeMsg = 0;
	m_infoMsg->IDLockkeyReceived = 0;


	pObject = this;
	SetTimer(NULL, NULL, 10000, TimerProcTuners_Wrapper);
}
開發者ID:vdomin,項目名稱:HDHRProxyIPTV,代碼行數:51,代碼來源:Control.cpp

示例14: OnBnClickedButtonRemove

void CMissedCallsDlg::OnBnClickedButtonRemove()
{
	// TODO: Add your control notification handler code here
	CString sDate, sTime, callee, callerID;
	int nItem = m_list.GetNextItem(-1, LVNI_SELECTED);
	if (nItem==-1)
		return;
	if (MessageBox(_("Are you sure you want to delete the selected items?"), APP_NAME, MB_YESNO | MB_ICONQUESTION)==IDYES) {		
		CppSQLite3DB db;
		db.open(CStringA(OUTCALL_DB));			
		
		CString query, table;
		if (m_cboShow.GetCurSel()==0)
			table="MissedCalls";
		else if (m_cboShow.GetCurSel()==1)
			table="RecivedCalls";
		else
			table="PlacedCalls";		

		int nIndex;

		try {

			db.execDML("begin transaction");

			while (nItem!=-1) { //from to time date
				callerID = m_list.GetItemText(nItem, 0);
				callee = m_list.GetItemText(nItem, 1);
				sDate = m_list.GetItemText(nItem, 2);
				nIndex = sDate.Find(_T(", "));
				sTime = sDate.Mid(nIndex+2);
				sDate = sDate.Mid(0, nIndex);

				query = "delete from " + table + " where (CallerID='" + EscapeSQLString(callerID) + "' and Callee='" + 
					EscapeSQLString(callee) + "' and Date='" + sDate +"' and Time='" + sTime + "')";
				db.execDML(query.GetBuffer());
				
				m_list.DeleteItem(nItem);
				nItem--;
				nItem = m_list.GetNextItem(nItem, LVNI_SELECTED);
			}

			db.execDML("end transaction");		

		} catch (CppSQLite3Exception& e) { }
	}
	BOOL bEnable = (m_list.GetNextItem(-1, LVNI_SELECTED)!=-1)?TRUE:FALSE;
	GetDlgItem(IDC_BUTTON_REMOVE)->EnableWindow(bEnable);
	GetDlgItem(IDC_BUTTON_CALL)->EnableWindow(bEnable);	
	m_btnAddContact.EnableWindow(bEnable && (::theApp.GetProfileInt("Settings", "OutlookFeatures", 1)==1));
}
開發者ID:bicomsystems,項目名稱:outcall,代碼行數:51,代碼來源:MissedCallsDlg.cpp

示例15: ReadMemoryStringA

CStringA ReadMemoryStringA(size_t address, SIZE_T max)
{
	auto buffer = std::make_unique<char[]>( max + 1 );
	SIZE_T bytesRead;
	
	if ( ReadMemory( (PVOID) address, buffer.get( ), max, &bytesRead ) != 0 )
	{
		for (int i = 0; i < bytesRead; i++)
		{
			if ( !( isprint( buffer[ i ] ) ) && buffer[ i ] != '\0' )
				buffer[i] = '.';
		}

		buffer[bytesRead] = '\0';

		return CStringA(buffer.get());
	} else {
#ifdef _DEBUG
		PrintOut( _T( "[ReadMemoryString]: Failed to read memory, GetLastError() = %s" ), Utils::GetLastErrorString( ).GetString( ) );
#endif
		return CStringA( ".." );
	}
}
開發者ID:ChunHungLiu,項目名稱:Reclass-2015,代碼行數:23,代碼來源:stdafx.cpp


注:本文中的CStringA函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。