How to compare two inspector objects?

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?
 
J

Jeff

Hi

As a quick thought, are your Inspector objects marshalled to different
threads / appartments? If so, you'll not be able to check the addresses of
the functions / objects.
 
X

xwjbs

yes,the code here is put in a single thread,not in the main thread. And the
application object is a varaible which comes from the main thread. I use the
function sleep() so it works just like a timer. As you know ,there is no
newinspector event can be fired in ol2000! I want to use this to find the
newinspector,and then put it into a collection. If i can't comare two
objects, it will replicate inspector. A function that processes message
will not be seemed another thread? And it will work? I try it ! Thank you!
 
X

xwjbs

I try to use settimer(),but it can't work either. I find that the __vfptr
member stay same all the time. Can i use it(i can't get it)? Would you like
to give me other advice? How to check it in a one thread? Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top