Aracılığıyla paylaş


CComBSTR::operator!

Denetler mi BSTR boş bir dizedir.

bool operator !( ) const throw( );

Dönüş Değeri

Döndürür doğru , m_str üye olduğu null; Aksi takdirde, yanlış.

Notlar

Bu işleci yalnızca boş bir dize için null değeri denetler.

Örnek

// STDMETHOD(BSTRToUpper)(/*[in, out]*/ BSTR bstrConv);
STDMETHODIMP InplaceBSTRToUpper(BSTR bstrConv)
{
   // Assign bstrConv to m_str member of CComBSTR
   CComBSTR bstrTemp;
   bstrTemp.Attach(bstrConv); 

   // Make sure BSTR is not NULL string
   if (!bstrTemp)
        return E_POINTER;

   // Make string uppercase 
   HRESULT hr;
   hr = bstrTemp.ToUpper();
   if (hr != S_OK)
       return hr;

   // Set m_str to NULL, so the BSTR is not freed
   bstrTemp.Detach(); 

   return S_OK; 
}

Gereksinimler

Başlık: atlbase.h

Ayrıca bkz.

Başvuru

CComBSTR Sınıfı