本文整理汇总了C++中CComBSTR::Detach方法的典型用法代码示例。如果您正苦于以下问题:C++ CComBSTR::Detach方法的具体用法?C++ CComBSTR::Detach怎么用?C++ CComBSTR::Detach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComBSTR
的用法示例。
在下文中一共展示了CComBSTR::Detach方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetErrorDescription
STDMETHODIMP CCUBRIDErrorLookup::GetErrorDescription(HRESULT hrError,
DWORD dwLookupID, DISPPARAMS *pdispparams, LCID lcid,
BSTR *pbstrSource, BSTR *pbstrDescription)
{
if(pbstrSource==NULL || pbstrDescription==NULL)
return E_INVALIDARG;
CComBSTR strSource = "CUBRIDProvider";
*pbstrSource = strSource.Detach();
CComBSTR strDesc;
if(dwLookupID==0)
{
strDesc = GetErrorDescriptionString(hrError);
}
else if(dwLookupID==1) // cci error
{
strDesc = V_BSTR(&pdispparams[0].rgvarg[0]);
}
*pbstrDescription = strDesc.Detach();
return S_OK;
}
示例2: getProductName
STDMETHODIMP CJoystickCtl::getProductName(BSTR *pName) {
USES_CONVERSION;
char* name = stick.getProductName();
CComBSTR wName = A2W(name);
*pName = wName.Detach();
return S_OK;
}
示例3: saveAsText
STDMETHODIMP ASDTDModel::saveAsText(BSTR *pVal)
{
if (pVal == NULL) return E_POINTER;
CComBSTR text = OLESTR("");
for (int i = 0; i < m_elementDeclarations->m_items.GetSize(); i++)
{
CASDTDElement* pElement = (CASDTDElement*)m_elementDeclarations->m_items[i];
text += pElement->GetAsText();
if (pElement->m_attributeDecls->m_items.GetSize() > 0)
{
text += OLESTR("<!ATTLIST ");
text += pElement->m_name;
text += OLESTR(" ");
for (int j = 0; j < pElement->m_attributeDecls->m_items.GetSize(); j++)
{
CASDTDAttribute* pAttribute = (CASDTDAttribute*)pElement->m_attributeDecls->m_items[j];
text += pAttribute->m_name;
text += OLESTR("\n");
}
text += OLESTR(">\n");
}
}
*pVal = text.Detach();
return S_OK;
}
示例4: GetFilename
BSTR DocTracker::GetFilename()
{
_ASSERT( IsValid() );
HRESULT hr = S_OK;
RefPtr<MagoST::ISession> session;
MagoST::FileInfo info = { 0 };
CComBSTR filename;
if ( !mCurData.mHasLineInfo )
return NULL;
if ( !mCurData.mMod->GetSymbolSession( session ) )
return NULL;
hr = session->GetFileInfo( mCurData.mCompilandIndex, mCurData.mFileIndex, info );
if ( FAILED( hr ) )
return NULL;
hr = Utf8To16( info.Name.ptr, info.Name.length, filename.m_str );
if ( FAILED( hr ) )
return NULL;
return filename.Detach();
}
示例5: switch
//////////////////////////////////////////////////////////////////////////////
// C[!output Safe_root]::GetPresetTitle
// Invoked when a host wants to obtain the title of the given preset
//////////////////////////////////////////////////////////////////////////////
STDMETHODIMP C[!output Safe_root]::GetPresetTitle(LONG nPreset, BSTR *bstrPresetTitle)
{
if (NULL == bstrPresetTitle)
{
return E_POINTER;
}
if ((nPreset < 0) || (nPreset >= PRESET_COUNT))
{
return E_INVALIDARG;
}
CComBSTR bstrTemp;
switch (nPreset)
{
case PRESET_BARS:
bstrTemp.LoadString(IDS_BARSPRESETNAME);
break;
case PRESET_SCOPE:
bstrTemp.LoadString(IDS_SCOPEPRESETNAME);
break;
}
if ((!bstrTemp) || (0 == bstrTemp.Length()))
{
return E_FAIL;
}
*bstrPresetTitle = bstrTemp.Detach();
return S_OK;
}
示例6: GetFilter_new
HRESULT GetFilter_new(dimension_t dimension, short index, BSTR* filter)
{
std::string szFG;
std::string szFV;
int newIndex = offset_to_new_index_(atFilter,dimension, index);
XXGetFilterEx_(dimension, newIndex, &szFG, &szFV);
CComBSTR bFilter;
// ff::ignore_missing_arguments_scope scoper;
// fastformat::fmt(bFilter, "{0}{1}{2}{3}", szFG, winstl::w2m(strFilterSeparator), szFV);
#if 0
fastformat::write(bFilter, szFG, winstl::w2m(strFilterSeparator), szFV); // +1
*filter = bFilter.Detach();
#else /* ? 0 */
# if 1
*filter = fastformat::write(bFilter, szFG, winstl::w2m(strFilterSeparator), szFV).Detach(); // +1
# else /* ? 0 */
// This should not work, but does with some compilers ...
*filter = fastformat::write(CComBSTR(), szFG, winstl::w2m(strFilterSeparator), szFV).Detach(); // +1
# endif /* 0 */
#endif /* 0 */
return S_OK;
}
示例7: GetApplicationName
HRESULT WMPlayerRemoteApi::GetApplicationName(BSTR * bstrName) {
HRESULT hresult = E_POINTER;
if(bstrName) {
CComBSTR bstrApplicationName = APPNAME;
*bstrName = bstrApplicationName.Detach();
hresult = *bstrName? S_OK : E_POINTER;
}
return hresult;
}
示例8: GetAltFileFilter
STDMETHODIMP CMapGeoPunktDLK::GetAltFileFilter(BSTR* pbstrFilter)
{
CHECKINPOINTER(pbstrFilter);
CComBSTR S;
VERIFY(S.LoadString (_Module.GetResourceInstance(), IDS_DISPLAYFILTER_DLK));
*pbstrFilter = S.Detach();
return S_OK;
}
示例9: GetDisplayName
STDMETHODIMP CMapGeoPunktDLK::GetDisplayName(BSTR *pbstrDisplay)
{
CHECKINPOINTER(pbstrDisplay);
CComBSTR S;
VERIFY(S.LoadString (_Module.GetResourceInstance(), IDS_DISPLAYNAME_DLK));
*pbstrDisplay = S.Detach();
return S_OK;
}
示例10: GetDescription
STDMETHODIMP CMapGeoPunktDLK::GetDescription(BSTR *prgFlags)
{
CHECKINPOINTER(prgFlags);
CComBSTR bstrDesc;
VERIFY(bstrDesc.LoadString(_Module.GetResourceInstance(), IDS_DESCRIPTION));
*prgFlags = bstrDesc.Detach();
return S_OK;
}
示例11: GetDisplayName
STDMETHODIMP CMapReferenced::GetDisplayName(/*[out]*/ BSTR* strDisplay) {
if(!strDisplay)
return E_POINTER;
// *strDisplay = ::SysAllocString( L"Rasterkarte mit Referenzinformationen\\Karte mit bekannten Eckpunkten" );
CComBSTR S;
VERIFY(S.LoadString (_Module.GetResourceInstance(), IDS_DISPLAYNAME_REF));
*strDisplay = S.Detach();
return S_OK;
}
示例12: GetApplicationName
//***************************************************************************
// GetApplicationName()
// Return the application name. It will be shown in player's menu View >
// Switch to applications
//***************************************************************************
HRESULT CRemoteHost::GetApplicationName(BSTR * pbstrName)
{
HRESULT hr = E_POINTER;
if(pbstrName)
{
CComBSTR bstrAppName = L"";
bstrAppName.LoadString(IDS_PROJNAME);
*pbstrName = bstrAppName.Detach();
hr = *pbstrName? S_OK : E_POINTER;
}
return hr;
}
示例13: get_StateDescription
STDMETHODIMP CRom::get_StateDescription(BSTR *pVal)
{
CComBSTR sStateDescription;
switch ( m_dwState ) {
case AUD_ROM_GOOD:
sStateDescription = "OK";
break;
case AUD_ROM_NEED_REDUMP:
sStateDescription = "Need redump";
break;
case AUD_ROM_NOT_FOUND:
sStateDescription = "Not found";
break;
case AUD_NOT_AVAILABLE:
sStateDescription = "Not available";
break;
case AUD_BAD_CHECKSUM:
sStateDescription = "Bad checksum";
break;
case AUD_MEM_ERROR:
sStateDescription = "Memory error";
break;
case AUD_LENGTH_MISMATCH:
sStateDescription = "Length mismatch";
break;
case AUD_ROM_NEED_DUMP:
sStateDescription = "Need dump";
break;
default:
sStateDescription = "Unknown";
break;
}
*pVal = sStateDescription.Detach();
return S_OK;
}
示例14: FormatValue
BSTR Property::FormatValue( int radix )
{
if ( mObjVal.ObjVal._Type == NULL )
return NULL;
HRESULT hr = S_OK;
CComBSTR str;
MagoEE::FormatOptions fmtopts (mFormatOpts);
if (fmtopts.radix == 0)
fmtopts.radix = radix;
hr = MagoEE::EED::FormatValue( mExprContext, mObjVal.ObjVal, fmtopts, str.m_str );
if ( FAILED( hr ) )
return NULL;
return str.Detach();
}
示例15: get_DatasetDescription
STDMETHODIMP CSimplePointWorkspaceFactory::get_DatasetDescription(esriDatasetType DatasetType, BSTR *dsDesc)
{
if (! dsDesc) return E_POINTER;
CComBSTR str;
// we only support feature classes
switch (DatasetType)
{
case esriDTFeatureClass:
str = L"SimplePoint Feature Class";
break;
default:
str = L"";
}
*dsDesc = str.Detach();
return S_OK;
}
开发者ID:Aleksei-Iagur,项目名称:arcobjects-sdk-community-samples,代码行数:18,代码来源:SimplePointWorkspaceFactory.cpp