本文整理汇总了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());
}
示例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();
}
示例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();
}
示例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);
}
}
示例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));
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
}
示例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 "";
}
示例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);
}
示例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();
}
}
示例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);
}
示例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));
}
示例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( ".." );
}
}