Re: How to retrieve this pointer
- From: "Peter" <Peter@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 26 May 2005 01:04:02 -0700
Yes I agree.
I did not design this application, but I must to make it functional now.
I dont like retrieving this pointer of com instance, it is temporary solution
because deadline knocks on our door.
Have you any tip how to do it ?
Peter
"Alexander Nickolov" wrote:
> So far, all very special cases I've seen that need this can be
> summed up with two words: bad design...
>
> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD
> email: agnickolov@xxxxxxxx
> MVP VC FAQ: http://www.mvps.org/vcfaq
> =====================================
>
> "Peter" <Peter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:B96B0487-36E4-4DB6-9E1C-4481ADC79067@xxxxxxxxxxxxxxxx
> > My case is very special.
> > Can you give me some tips, link to articles ot other for trick with
> > retrieving this pointer ?
> >
> > Thanks !
> > Peter
> >
> > "Igor Tandetnik" wrote:
> >
> >> "Peter" <Peter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> news:9EBEA11E-C44F-4BF9-BA85-2607DBBF438B@xxxxxxxxxxxxx
> >> > I have created comclass instance and I have pointer to i'ts IUnknown.
> >> > I need to retrieve this pointer for created instance.
> >> > How to do it ?
> >>
> >> In general, you don't. There are tricks to do it, but they are fragile
> >> and best avoided.
> >>
> >> If you create an instance of your coclass yourself, in the same module
> >> where it is implemented, you can use this instead of CoCreateInstance:
> >>
> >> CComObject<CMyClass>* pMyClass;
> >> CComObject<CMyClass>::CreateInstance(&pMyClass);
> >> // Here, pMyClass is a pointer to CComObject<CMyClass>
> >> // which is derived from CMyClass, so you can access all its
> >> // regular C++ methods.
> >> // Remember, the object is created with a refcount of 0 (zero).
> >>
> >> --
> >> 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
> >>
> >>
> >>
>
>
>
.
- Follow-Ups:
- Re: How to retrieve this pointer
- From: Kim Gräsman
- Re: How to retrieve this pointer
- From: Alexander Nickolov
- Re: How to retrieve this pointer
- References:
- How to retrieve this pointer
- From: Peter
- Re: How to retrieve this pointer
- From: Igor Tandetnik
- Re: How to retrieve this pointer
- From: Peter
- Re: How to retrieve this pointer
- From: Alexander Nickolov
- How to retrieve this pointer
- Prev by Date: Re: ActiveX object doesnt get installed at client
- Next by Date: Header dependency & smart pointers (not ATL specific)
- Previous by thread: Re: How to retrieve this pointer
- Next by thread: Re: How to retrieve this pointer
- Index(es):
Relevant Pages
|