本文整理汇总了C++中CStdString::GetData方法的典型用法代码示例。如果您正苦于以下问题:C++ CStdString::GetData方法的具体用法?C++ CStdString::GetData怎么用?C++ CStdString::GetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStdString
的用法示例。
在下文中一共展示了CStdString::GetData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Notify
void ZYGroupCreator::Notify(TNotifyUI& msg) {
if (!_tcscmp(msg.sType, _T("windowinit"))) {
::SetWindowLong(m_hWnd, GWL_STYLE, ::GetWindowLong(m_hWnd, GWL_STYLE) & ~WS_CAPTION | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
}
else if (!_tcscmp(msg.sType, _T("click"))) {
if (!_tcscmp(msg.pSender->GetName(), _T("closebutton")) || !_tcscmp(msg.pSender->GetName(), _T("cancelbutton"))) {
Close();
} else if (!_tcscmp(msg.pSender->GetName(), _T("okbutton"))) {
CEditUI *edit;
if ((edit = (CEditUI *) m_paintManagerUi.FindControl(_T("groupname")))) {
CStdString sql;
CStdString groupname = edit->GetText();
if (!groupname.IsEmpty()) {
sql.Format(_T("INSERT INTO `group` (name) VALUES ('%s'); "), groupname.GetData());
if (ZYDbHelper::GetInstance()->Query(sql.GetData(), NULL)) {
if (m_cb) {
m_cb->OnGroup(groupname.GetData());
}
Close();
}
}
}
}
}
}
示例2: TimerProc
VOID WINAPI ZYWallpaperHelper::TimerProc(HWND hWnd, UINT uMsg, UINT_PTR nIDEvent, DWORD dwTime) {
ZYConfigurator *configurator = ZYConfigurator::GetInstance();
static ULONG tick;
static ULONG curr;
if (!_tcscmp(configurator->GetValue(_T("enabletimer")), _T("true"))) {
if (++tick == ::_ttoi(configurator->GetValue(_T("timerinterval")))) {
CStdString groupid = configurator->GetValue(_T("groupid"));
if (groupid.IsEmpty()) {
groupid = _T("1");
}
CStdString sql;
vector<vector<CStdString>> qset;
sql.Format(_T("SELECT path FROM `wallpaper` WHERE groupid=%s; "), groupid.GetData());
if (ZYDbHelper::GetInstance()->Query(sql.GetData(), &qset)) {
if (!qset.empty()) {
if (qset.size() <= curr) {
curr = 0;
}
ZYWallpaperHelper::GetInstance()->SetWallpaper(qset[curr++][0].GetData());
}
}
tick = 0;
}
}
}
示例3: PaintBkImage
void ZYContainerUi::PaintBkImage(HDC hDC) {
if(!m_sBkImage.IsEmpty()) {
CStdString olddir = CPaintManagerUI::GetResourceZip();
CPaintManagerUI::SetResourceZip(_T(""));
LONG pos = m_sBkImage.ReverseFind(_T('\\'));
CPaintManagerUI::SetResourcePath(m_sBkImage.Left(pos).GetData());
if (!DrawImage(hDC, m_sBkImage.Mid(pos).GetData())) {
m_sBkImage.Empty();
}
CPaintManagerUI::SetResourcePath(_T(""));
CPaintManagerUI::SetResourceZip(olddir.GetData());
}
}
示例4: ViCbGetToolTip
// wchar* ViCbGetToolTip(VApiHandle hWnd)
SQInteger ViCbGetToolTip(HSQUIRRELVM v)
{
SQInteger nargs = sq_gettop(v);
SQInteger Handle = 0;
CControlUI* pCtrl = NULL;
CStdString sName;
if (!v || 1 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
sq_getinteger(v, 2, &Handle);
pCtrl = QiHwHandleToCtrl(Handle);
if (!pCtrl) {goto _Exit_;}
sName = pCtrl->GetToolTip();
_Exit_:
sq_pushstring(v, sName.GetData(), sName.GetLength());
return 1;
}
示例5: OnInitDialog
BOOL CImageDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_btnMask.EnableOtherButton(_T("Other"));
m_btnMask.SetColor((COLORREF)0);
m_btnMask.SetColumnsNumber(10);
m_ctlFade.SetRange(0,255);
m_ctlFade.SetPos(255);
m_pManager=g_pMainFrame->GetActiveUIView()->GetPaintManager();
m_ImagePreview.SetManager(m_pManager);
g_HookAPI.EnableAddImage(false);
m_strImagePathName=m_strImageProperty;
LPCTSTR pStrImage=m_strImageProperty;
CStdString sItem;
CStdString sValue;
LPTSTR pstr = NULL;
while( *pStrImage != _T('\0') ) {
sItem.Empty();
sValue.Empty();
while( *pStrImage != _T('\0') && *pStrImage != _T('=') ) {
LPTSTR pstrTemp = ::CharNext(pStrImage);
while( pStrImage < pstrTemp) {
sItem += *pStrImage++;
}
}
if( *pStrImage++ != _T('=') ) break;
if( *pStrImage++ != _T('\'') ) break;
while( *pStrImage != _T('\0') && *pStrImage != _T('\'') ) {
LPTSTR pstrTemp = ::CharNext(pStrImage);
while( pStrImage < pstrTemp) {
sValue += *pStrImage++;
}
}
if( *pStrImage++ != _T('\'') ) break;
if( !sValue.IsEmpty() ) {
if( sItem == _T("file"))
m_strImagePathName = sValue;
else if( sItem == _T("dest") )
m_strDest = sValue;
else if( sItem == _T("source") )
m_strSource = sValue;
else if( sItem == _T("corner") )
m_strCorner = sValue;
else if( sItem == _T("mask") ) {
DWORD dwMask;
if( sValue[0] == _T('#')) dwMask = _tcstoul(sValue.GetData() + 1, &pstr, 16);
else dwMask = _tcstoul(sValue.GetData(), &pstr, 16);
dwMask&=0x00FFFFFF;
m_btnMask.SetColor(RGB(GetBValue(dwMask),GetGValue(dwMask),GetRValue(dwMask)));
}
else if( sItem == _T("fade") ) {
m_nFade = (BYTE)_tcstoul(sValue.GetData(), &pstr, 10);
}
else if( sItem == _T("hole") ) {
m_bHole = (_tcscmp(sValue.GetData(), _T("true")) == 0);
}
}
if( *pStrImage++ != _T(' ') ) break;
}
m_ctlFade.SetPos(m_nFade);
int nIndex=m_lstImages.AddString(_T("(无)"));
m_lstImages.SetItemDataPtr(nIndex,(void*)(LPCTSTR)m_strNullImage);
const CStringArray* parrImage=g_pResourceView->GetAllImage();
LPCTSTR pstrImage=NULL;
LPTSTR pszFileName=NULL;
for(int i=0; i<parrImage->GetSize(); i++)
{
pstrImage=parrImage->GetAt(i);
pszFileName=_tcsrchr((LPTSTR)pstrImage,_T('\\'))+1;
nIndex=m_lstImages.AddString(pszFileName);
m_lstImages.SetItemDataPtr(nIndex,(void*)pstrImage);
}
pstrImage=m_strImagePathName;
pszFileName=_tcsrchr((LPTSTR)pstrImage,_T('\\'))+1;
m_strImagePathName.IsEmpty()?m_lstImages.SelectString(-1,_T("(无)")):m_lstImages.SelectString(-1,pszFileName);
UpdateData(FALSE);
SetImageProperty(m_strImagePathName);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例6: Notify
void Notify(TNotifyUI& msg)
{
if( msg.sType == _T("windowinit") )
OnPrepare(msg);
else if( msg.sType == _T("click") )
{
if( msg.pSender == m_pCloseBtn )
{
PostQuitMessage(0);
return;
}
else if( msg.pSender == m_pMinBtn )
{
SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0);
return;
}
else if( msg.pSender == m_pMaxBtn )
{
SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0); return;
}
else if( msg.pSender == m_pRestoreBtn )
{
SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0); return;
}
else if(msg.pSender == m_pSearch)
{
OnSearch();
}
}
else if(msg.sType==_T("setfocus"))
{
}
else if( msg.sType == _T("itemclick") )
{
}
else if( msg.sType == _T("itemactivate") )
{
int iIndex = msg.pSender->GetTag();
CStdString sMessage = _T("Click: ");;
#ifdef _UNICODE
int iLen = domain[iIndex].length();
LPWSTR lpText = new WCHAR[iLen + 1];
::ZeroMemory(lpText, (iLen + 1) * sizeof(WCHAR));
::MultiByteToWideChar(CP_ACP, 0, domain[iIndex].c_str(), -1, (LPWSTR)lpText, iLen) ;
sMessage += lpText;
delete[] lpText;
#else
sMessage += domain[iIndex].c_str();
#endif
::MessageBox(NULL, sMessage.GetData(), _T("提示(by tojen)"), MB_OK);
}
else if(msg.sType == _T("menu"))
{
if( msg.pSender->GetName() != _T("domainlist") ) return;
CMenuWnd* pMenu = new CMenuWnd();
if( pMenu == NULL ) { return; }
POINT pt = {msg.ptMouse.x, msg.ptMouse.y};
::ClientToScreen(*this, &pt);
pMenu->Init(msg.pSender, pt);
}
else if( msg.sType == _T("menu_Delete") ) {
CListUI* pList = static_cast<CListUI*>(msg.pSender);
int nSel = pList->GetCurSel();
if( nSel < 0 ) return;
pList->RemoveAt(nSel);
domain.erase(domain.begin() + nSel);
desc.erase(desc.begin() + nSel);
}
}