本文整理汇总了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;
}
示例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;
}