📄 compare.cpp
字号:
//... IDog interface pointer is in variable pIDog ...
//... IChihuahua interface pointer is in variable pIChihuahua ...
HRESULT result = E_FAIL;
IUnknown* pDogIUnknown = NULL;
IUnknown* pChihuhuaIUnknown = NULL;
// Get the IUnknown interface pointer for the IDog
result = pIDog->QueryInterface(IID_IUnknown, (void**) &pDogIUnknown);
if (FAILED(result))
{
// ... Error processing ...
}
// Get the IUnknown interface pointer for the IChihuahua
result = pIChihuahua->QueryInterface(IID_IUnknown, (void**) &pChihuahuaIUnknown);
if (FAILED(result))
{
// ... Error processing ...
}
// Do both of these interface pointers belong to the same object?
if (pDogIUnknown == pChihuahuaIUnknown)
{
cout << "The IDog and IChihuahua interfaces belong to "
"the same component.\n";
{
else
{
cout << "The IDog and IChihuahua interfaces DO NOT belong to "
"the same component.\n";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -