X
xwjbs
I want to compare two objects. The objects type is MS Outlook inspectors.
Here is the code.
struct Outlook::_Inspector* activeIn;
m_spApp->ActiveInspector(&activeIn);
if(NULL == activeIn)
continue;
CComPtr<IUnknown> activeUnk;
activeIn->QueryInterface(IID_IUnknown, (void**)&activeUnk);
struct Outlook::_Inspector* inspector;
CComPtr<IUnknown> spInspectUnk;
//IUnknown* spInspectUnk;
///*
for(long i=1;i<=nNowNum;i++)
{
inspectors->Item(CComVariant(i),&inspector);
if(NULL == inspector || 0xcccccccc == (long)inspector)
continue;
inspector->IsWordMail(&bWordMail);
if(!bWordMail)
continue;
inspector->QueryInterface(IID_IUnknown, (void**)&spInspectUnk);
if(spInspectUnk.IsEqualObject(activeUnk))
{
//dosomething
//how to come in this block
}
}
I set a timer to check inspectors collection! But every time the value of
spInspectUnk changes. Would you like to tell me how to compare them?
Here is the code.
struct Outlook::_Inspector* activeIn;
m_spApp->ActiveInspector(&activeIn);
if(NULL == activeIn)
continue;
CComPtr<IUnknown> activeUnk;
activeIn->QueryInterface(IID_IUnknown, (void**)&activeUnk);
struct Outlook::_Inspector* inspector;
CComPtr<IUnknown> spInspectUnk;
//IUnknown* spInspectUnk;
///*
for(long i=1;i<=nNowNum;i++)
{
inspectors->Item(CComVariant(i),&inspector);
if(NULL == inspector || 0xcccccccc == (long)inspector)
continue;
inspector->IsWordMail(&bWordMail);
if(!bWordMail)
continue;
inspector->QueryInterface(IID_IUnknown, (void**)&spInspectUnk);
if(spInspectUnk.IsEqualObject(activeUnk))
{
//dosomething
//how to come in this block
}
}
I set a timer to check inspectors collection! But every time the value of
spInspectUnk changes. Would you like to tell me how to compare them?