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


C++ CComQIPtr::GetName方法代码示例

本文整理汇总了C++中CComQIPtr::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ CComQIPtr::GetName方法的具体用法?C++ CComQIPtr::GetName怎么用?C++ CComQIPtr::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CComQIPtr的用法示例。


在下文中一共展示了CComQIPtr::GetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetTargetNamespace

IASDataTypeDeclaration* /*CTypeDefinition* */ CASXMLSchemaModel::FindTypeElementByName(ILDOMNode* parent, BSTR btypename)
{
	_bstr_t targetNamespace = GetTargetNamespace();

	_bstr_t uri;
	_bstr_t local;
	ExtractURILocal(parent, btypename, uri, local);

// Find a 'complexType'/'simpleType element with name attribute belLocalName
	for (int i = 0; i < m_globalDefs.m_defs.GetSize(); i++)
	{
		IASDeclaration* pDef = /*(CTypeDefinition*)*/m_globalDefs.m_defs[i];

		CComBSTR type;
		pDef->GetDefType(&type);

		if (!wcscmp(type, L"complexType") ||
			!wcscmp(type, L"simpleType"))
		{
			CComQIPtr<IASDataTypeDeclaration> typedecl = pDef;

			CComBSTR name;
			typedecl->GetName(&name);

			if (!wcscmp(name, local))
			{
				return typedecl.p;
			}
		}
	}

	return NULL;
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:33,代码来源:ASXMLSchemaModel.cpp

示例2: if

HRESULT
AsdkSheetSet::List(IAcSmDatabase *pDb)
{
	// List the contents of the sheet set at the command line

	HRESULT hr;

	if(!pDb)
		return E_FAIL;

	CComPtr<IAcSmEnumPersist> pEnum;
    CComPtr<IAcSmPersist> pItem;

    pDb->GetEnumerator(&pEnum);
	pEnum->Reset();

	acutPrintf("\n ********  BEGIN  ************** ");
	acutPrintf("\n");
	while(SUCCEEDED(hr=pEnum->Next(&pItem)) && pItem)
    {
        CComQIPtr<IAcSmSubset> pSubSet = pItem;
		CComQIPtr<IAcSmSheet> pSheet = pItem;
		CComQIPtr<IAcSmCustomPropertyBag> pPropertyBag = pItem;
		CComBSTR bstrTypeName;

		char name[80];
		char desc[255];

        if (pSubSet != NULL)
        {
			BSTR bstrSubsetName;
			BSTR bstrSubSetDesc;
			pSubSet->GetName(&bstrSubsetName);
			pSubSet->GetDesc(&bstrSubSetDesc);
			strcpy(name, _bstr_t(bstrSubsetName).operator char*());
			strcpy(desc, _bstr_t(bstrSubSetDesc).operator char*());
			acutPrintf("\n -------------------------------");
			acutPrintf("\n SubSet Name : %s", name);
			acutPrintf("\n Description : %s", desc);
			acutPrintf("\n -------------------------------");
		} else if(pSheet != NULL)
		{
			BSTR bstrSheetName;
			BSTR bstrSheetDesc;
			BSTR bstrLayoutName;
			BSTR bstrFileName;
			char layout[80];
			char fileName[255];
			CComPtr<IAcSmAcDbLayoutReference> pLayoutRef;
			pSheet->GetName(&bstrSheetName);
			pSheet->GetDesc(&bstrSheetDesc);
			pSheet->GetLayout(&pLayoutRef);
			if (pLayoutRef)
			{
				pLayoutRef->GetName(&bstrLayoutName);
				pLayoutRef->GetFileName(&bstrFileName);
			}
			strcpy(name, _bstr_t(bstrSheetName).operator char*());
			strcpy(desc, _bstr_t(bstrSheetDesc).operator char*());
			strcpy(layout, _bstr_t(bstrLayoutName).operator char*());
			strcpy(fileName, _bstr_t(bstrFileName).operator char*());
			acutPrintf("\n         Sheet             : %s", name);
			acutPrintf("\n         Sheet Description : %s", desc);
			acutPrintf("\n         Layout Name       : %s", layout);
			acutPrintf("\n         FileName Name     : %s", fileName);
			acutPrintf("\n");
		} else if(pPropertyBag != NULL)
		{
			CComVariant val;
			CComQIPtr<IAcSmEnumProperty> pEnumProp;
			pPropertyBag->GetPropertyEnumerator(&pEnumProp);
			HRESULT hr;
			BSTR propName;
			BSTR propValue;

			pEnumProp->Reset();
			CComQIPtr<IAcSmCustomPropertyValue> pValue;
			while(pEnumProp->Next(&propName,&pValue)== S_OK)
			{
				strcpy(name, _bstr_t(propName).operator char*());
				acutPrintf("\n         Property Name       : %s", name);
				pValue->GetValue(&val);
				if(V_VT(&val)==VT_BSTR)
				{    // This Value is never VT_BSTR so what is wrong here???
					_bstr_t propValue = val;
					strcpy(desc, _bstr_t(propValue).operator char*());
					acutPrintf("\n         Property Value      : %s", desc);
				}
			}

		}
        
    } 

	acutPrintf("\n");
	acutPrintf("\n ********   END   ************** ");

	return S_OK;
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:99,代码来源:SS.cpp


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