本文整理汇总了C++中IObject::GetClassID方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::GetClassID方法的具体用法?C++ IObject::GetClassID怎么用?C++ IObject::GetClassID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObject
的用法示例。
在下文中一共展示了IObject::GetClassID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _CObject_ReflectInterfaceInfo
ELAPI _CObject_ReflectInterfaceInfo(
/* [in] */ PInterface object,
/* [out] */ IInterfaceInfo** interfaceInfo)
{
if (!object || !interfaceInfo) {
return E_INVALID_ARGUMENT;
}
EIID iid;
ECode ec = object->GetInterfaceID(object, &iid);
if (FAILED(ec)) return E_INVALID_ARGUMENT;
IObject* iObject = (IObject*)object->Probe(EIID_IObject);
if (iObject == NULL) return E_NO_INTERFACE;
ClassID clsid;
ec = iObject->GetClassID(&clsid);
if (FAILED(ec)) return E_INVALID_ARGUMENT;
AutoPtr<IModuleInfo> obj;
ec = _CReflector_AcquireModuleInfo(String(clsid.mUunm), (IModuleInfo**)&obj);
if (FAILED(ec)) {
return ec;
}
CModuleInfo* moduleInfo = (CModuleInfo*)obj.Get();
ClassDirEntry* classDir = NULL;
ClassDescriptor* clsDesc = NULL;
ClassInterface* cifDir = NULL;
InterfaceDirEntry* ifDir = NULL;
InterfaceDescriptor* ifDesc = NULL;
UInt16 index = 0;
Int32 base = moduleInfo->mClsModule->mBase;
*interfaceInfo = NULL;
for (Int32 i = 0; i < moduleInfo->mClsMod->mClassCount; i++) {
classDir = getClassDirAddr(base, moduleInfo->mClsMod->mClassDirs, i);
clsDesc = adjustClassDescAddr(base, classDir->mDesc);
//find the class
if (clsDesc->mClsid == clsid.mClsid) {
for (Int32 j = 0; j < clsDesc->mInterfaceCount; j++) {
cifDir = getCIFAddr(base, clsDesc->mInterfaces, j);
index = cifDir->mIndex;
ifDir = getInterfaceDirAddr(base,
moduleInfo->mClsMod->mInterfaceDirs, index);
ifDesc = adjustInterfaceDescAddr(base, ifDir->mDesc);
//find the interface
if (ifDesc->mIID == iid) {
ec = g_objInfoList.AcquireInterfaceInfo(
moduleInfo->mClsModule, index, (IInterface **)interfaceInfo);
return ec;
}
}
}
}
return E_DOES_NOT_EXIST;
}
示例2: _Impl_CheckClsId
ELAPI _Impl_CheckClsId(
/* [in] */ PInterface serverObj,
/* [in] */ const ClassID* classiD,
/* [out] */ PInterface* outServerObj)
{
IObject* object;
char str[80];
ClassID clsid;
clsid.mUunm = str;
object = (IObject*)serverObj->Probe(EIID_IObject);
if (NULL == object) return E_INVALID_ARGUMENT;
object->GetClassID(&clsid);
while (*(EMuid *)&clsid != *(EMuid *)classiD) {
object = (IObject*)object->Probe(EIID_SUPER_OBJECT);
if (NULL == object) return E_INVALID_ARGUMENT;
object->GetClassID(&clsid);
}
*outServerObj = object; // don't AddRef, Caller don't Release either.
return NOERROR;
}
示例3: _CObject_ReflectModuleInfo
ELAPI _CObject_ReflectModuleInfo(
/* [in] */ PInterface object,
/* [out] */ IModuleInfo** moduleInfo)
{
if (!object || !moduleInfo) {
return E_INVALID_ARGUMENT;
}
IObject* iObject = (IObject*)object->Probe(EIID_IObject);
if (iObject == NULL) return E_NO_INTERFACE;
ClassID clsid;
ECode ec = iObject->GetClassID(&clsid);
if (FAILED(ec)) {
return E_NO_INTERFACE;
}
return _CReflector_AcquireModuleInfo(String(clsid.mUunm), moduleInfo);
}
示例4: _CObject_ReflectClassInfo
ELAPI _CObject_ReflectClassInfo(
/* [in] */ PInterface object,
/* [out] */ IClassInfo** classInfo)
{
if (!object || !classInfo) {
return E_INVALID_ARGUMENT;
}
IObject* iObject = (IObject*)object->Probe(EIID_IObject);
if (iObject == NULL) return E_NO_INTERFACE;
ClassID clsid;
ECode ec = iObject->GetClassID(&clsid);
if (FAILED(ec)) {
return E_NO_INTERFACE;
}
AutoPtr<IModuleInfo> iModuleInfo;
ec = g_objInfoList.AcquireModuleInfo(String(clsid.mUunm),
(IModuleInfo**)&iModuleInfo);
if (FAILED(ec)) {
return ec;
}
CModuleInfo* moduleInfo = (CModuleInfo*)iModuleInfo.Get();
ClassDirEntry* classDir = NULL;
ClassDescriptor* clsDesc = NULL;
Int32 base = moduleInfo->mClsModule->mBase;
*classInfo = NULL;
for (Int32 i = 0; i < moduleInfo->mClsMod->mClassCount; i++) {
classDir = getClassDirAddr(base, moduleInfo->mClsMod->mClassDirs, i);
clsDesc = adjustClassDescAddr(base, classDir->mDesc);
if (clsDesc->mClsid == clsid.mClsid) {
ec = g_objInfoList.AcquireClassInfo(moduleInfo->mClsModule,
classDir, (IInterface **)classInfo);
return ec;
}
}
return E_DOES_NOT_EXIST;
}