本文整理汇总了C++中atl::CString::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ CString::IsEmpty方法的具体用法?C++ CString::IsEmpty怎么用?C++ CString::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atl::CString
的用法示例。
在下文中一共展示了CString::IsEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnHBarSearchPrev
LRESULT CH_HBarWnd::OnHBarSearchPrev(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL& bHandled){
if(newpage){
return 0;
}
CComBSTR search_words = NULL;
m_BandEditCtrl.GetWindowText(&search_words);
ATL::CString sw = search_words.m_str;
if(sw.IsEmpty()){
return 0;
}
newpage = FALSE;
if(currentRange2==NULL){
CComQIPtr<IHTMLBodyElement,&IID_IHTMLBodyElement> bodyElement(body);
if(FAILED(bodyElement->createTextRange(¤tRange2)) && currentRange2==NULL){return 0;}
}
VARIANT_BOOL bSuccess;
long t=0;
if(wParam == HBAR_SEARCHPREVFAILED && lParam==HBAR_SEARCHPREVFAILED){//at the beginning
CComQIPtr<IHTMLBodyElement,&IID_IHTMLBodyElement> bodyElement(body);
if(FAILED(bodyElement->createTextRange(¤tRange2)) && currentRange2==NULL){return 0;}
}else{
currentRange2->setEndPoint(_T("EndToStart"),currentRange);
currentRange2->moveEnd(_T("Character"),-1*search_words.Length(),&t);
}
DWORD flag = (m_case.GetCheck()==BST_UNCHECKED?0:FINDTEXT_MATCHCASE);
if(currentRange2!=NULL && SUCCEEDED(currentRange2->findText(search_words,-1,flag,&bSuccess)) && bSuccess==VARIANT_TRUE){
int a=0;
if(FAILED(currentRange2->select())){a=1;}
currentRange->setEndPoint(_T("StartToEnd"),currentRange2);
if(a==1){::PostMessage(m_hWnd, WM_HBAR_SEARCH_PREV, 0, 0);}
}else{
::PostMessage(m_hWnd, WM_HBAR_SEARCH_PREV, HBAR_SEARCHPREVFAILED, HBAR_SEARCHPREVFAILED);
}
return 0;
}
示例2: OnCtlColorEdit
LRESULT CH_HBarWnd::OnCtlColorEdit(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL& bHandled){
HDC hdcEdit = (HDC) wParam; // handle to display context
HWND hwndEdit = (HWND) lParam; // handle to static control
if (hwndEdit==m_BandEditCtrl.m_hWnd)
{
CComBSTR search_words = NULL;
m_BandEditCtrl.GetWindowText(&search_words);
ATL::CString sw = search_words.m_str;
if(sw.IsEmpty() && bkcolor!=kGreen){
bkcolor = kGreen;
m_hBrush = ::CreateSolidBrush(bkcolor);
RECT rc;
m_BandEditCtrl.GetClientRect(&rc);
m_BandEditCtrl.InvalidateRect(&rc,TRUE);
}
if (m_hBrush == NULL)
m_hBrush = ::CreateSolidBrush(bkcolor);
SetBkColor(hdcEdit,bkcolor);
SetTextColor(hdcEdit, RGB(0,20,245));
return ((LRESULT) m_hBrush);
}
return 0;
}
示例3: CreateObject
// an instance of the requested add-in in that AppDomain.
HRESULT GenericCLRLoader::CreateObject(const ATL::CString& sAssemblyFile, const ATL::CString& sAssemblyName, const ATL::CString& sTypeName,
mscorlib::_ObjectHandle** ppObject, const ATL::CString& sConfigFile, const ATL::CString& sDomainName, int LocaleID)
{
HRESULT hr = E_FAIL;
try
{
m_skipCleanup = true;
// Ensure the common language runtime is running ...
IfFailGo( LoadCLR(sAssemblyFile) );
// In order to securely load an assembly, its fully qualified strong name
// and not the filename must be used. To do that, the target AppDomain's
// base directory needs to point to the directory where the assembly is
// residing. CreateLocalAppDomain() ensures that such AppDomain exists.
//
// VE3580 "Error:0x8000ffff is seen only on the first save to SharePoint. Windows XP SP3 with Office 2003"
// If no config file is specified when creating the appdomain the first time a Uri object is created an exception is thrown,
// Its trying to read a config file that is NULL. So specify a dummy file name to prevent this.
IfFailGo( CreateLocalAppDomain(sDomainName, sConfigFile.IsEmpty() ? "app.config" : sConfigFile) );
// Create an instance of the managed class
if (LocaleID != -1)
m_pLocalDomain->SetData(CComBSTR("LocaleID"), CComVariant(LocaleID));
IfFailGo(m_pLocalDomain->CreateInstance(CComBSTR(sAssemblyName), CComBSTR(sTypeName), ppObject));
}
catch(...)
{
LOG_WS_INFO(_T("Unable to load clr, create app domain, run CLRPolicyReader"));
}
Error:
return hr;
}