⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compare.cpp

📁 VC++串口通信设。本书详细说明讲解了在VC++环境下编写串口通信得过程。值得一看
💻 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 + -