当前位置: 首页>>代码示例>>C++>>正文


C++ CComBSTR::Detach方法代码示例

本文整理汇总了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;
}
开发者ID:BogdanStroe,项目名称:cubrid,代码行数:25,代码来源:Error.cpp

示例2: getProductName

STDMETHODIMP CJoystickCtl::getProductName(BSTR *pName) {
	USES_CONVERSION;
	char* name = stick.getProductName();
	CComBSTR wName = A2W(name);
	*pName = wName.Detach();
	return S_OK;
}
开发者ID:09898,项目名称:javascript-joystick,代码行数:7,代码来源:JoystickCtl.cpp

示例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;
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:34,代码来源:ASDTDModel.cpp

示例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();
    }
开发者ID:Stretto,项目名称:mago,代码行数:25,代码来源:DocTracker.cpp

示例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;
}
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:38,代码来源:sample.cpp

示例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;
}
开发者ID:JerYme,项目名称:fastformat,代码行数:35,代码来源:test.scratch.overload.3.BSTR_out_parameter.cpp

示例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;
}
开发者ID:Nordanvind,项目名称:airgit,代码行数:9,代码来源:WMPlayerRemoteApi.cpp

示例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;
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:10,代码来源:MapGeoPunktDLK.cpp

示例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;
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:10,代码来源:MapGeoPunktDLK.cpp

示例10: GetDescription

STDMETHODIMP CMapGeoPunktDLK::GetDescription(BSTR *prgFlags)
{
    CHECKINPOINTER(prgFlags);

    CComBSTR bstrDesc;

    VERIFY(bstrDesc.LoadString(_Module.GetResourceInstance(), IDS_DESCRIPTION));
    *prgFlags = bstrDesc.Detach();
    return S_OK;
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:10,代码来源:MapGeoPunktDLK.cpp

示例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;
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:11,代码来源:MapReferenced.cpp

示例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;
}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:17,代码来源:RemoteHost.cpp

示例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;
}
开发者ID:CarnyPriest,项目名称:SAMbuild,代码行数:46,代码来源:ControllerRom.cpp

示例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();
    }
开发者ID:Stretto,项目名称:mago,代码行数:17,代码来源:Property.cpp

示例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


注:本文中的CComBSTR::Detach方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。