Re: COM Interface intialization

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks Igor.

That works like a charm in the actual application.

I've never seen the CComObject<Q>::CreateInstance() used with
the CoClass. I found this very educational.

Sorry again for missing your piece of code.

This works 100%!

Steven

"Igor Tandetnik" <itandetnik@xxxxxxxx> wrote in message
news:%23qaldnOOHHA.5104@xxxxxxxxxxxxxxxxxxxxxxx
"Steven Edison" <EdisonCPP@xxxxxxxxxxxxxxxxx> wrote in message
news:O%23%23nPQOOHHA.1240@xxxxxxxxxxxxxxxxxxxx
So Igor what are you suggesting?

something like:

STDMETHODIMP CAnotherInterfaceImpl::GetItemInfo(IItemInfo** pRetUnk)
{
CItemInfo* pInfo = new CItemInfo; //above impl class
pInfo->SetSomeData(0x42); //exposed through impl. class, but

No. Something like the code I've shown. What makes you think I could be
suggesting anything other than precisely the code I've typed?

Now that you've changed the parameter type to IItemInfo**, change
IID_IUnknown to IID_IItemInfo in my code and make it the body of
GetItemInfo method. It should work as is.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



.



Relevant Pages