[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-atl
Subject:    Re: CAspPtr
From:       Chris Sells <csells () SELLSBROTHERS ! COM>
Date:       1998-12-31 21:57:11
[Download RAW message or body]


Hmmm... Interesting. In general, you'd like a way to get an interface from
an object at an arbitrary location in an object model. I'll think on it. : )

Chris Sells
http://www.sellsbrothers.com

> -----Original Message-----
> From: ATL - Active Template Library [mailto:ATL@DISCUSS.MICROSOFT.COM]On
> Behalf Of Box, Don
> Sent: Wednesday, December 30, 1998 3:00 PM
> To: ATL@DISCUSS.MICROSOFT.COM
> Subject: Re: CAspPtr
>
>
> Wow Chris, you're the man. That being said, how about changing the name to
> CCtxPtr and having specializations for IObjectContext,
> IObjectContextActivity and ISecurityProperty et al that just does the
> CoGetObjectContext?
>
> That would allow:
>
> STDMETHODIMP CJon::DoIt() {
>   CCtxPtr<IObjectContext> oc;
>   oc->DisableCommit();
>   CCtxPtr<IResponse> resp;
>   resp->Write(CComVariant(OLESTR("baby baby")));
>   oc->SetComplete();
> }
>
> Or how about something that looks like this:
>
> STDMETHODIMP CJon::DoIt() {
>   ObjectContext thisObject; // calls CoGetObjectContext
>   CallContext   thisCall;   // calls CoGetCallContext
>   octx->DisableCommit();
>   octx["Request", IRequest]->Write(CComVariant(OLESTR("baby baby")));
>   cctc->InpersonateClient();
>   octx(IObjectContextActivity)->GetActivityId(&someguid);
>   octx->SetComplete();
> }
>
> Of course, the C++ to make it work is less than obvious, but then
> again, you
> are Chris Sells ;-)
>
> DB
> http://www.develop.com/dbox
>
>
> > -----Original Message-----
> > From: Chris Sells [mailto:csells@SELLSBROTHERS.COM]
> > Sent: Wednesday, December 30, 1998 12:43 PM
> > To: ATL@DISCUSS.MICROSOFT.COM
> > Subject: CAspPtr
> >
> >
> > If you've ever had to write the code to pull the ASP
> > intrinsic objects from
> > the MTS context, you might appreciate CAspPtr, which allows
> > the following:
> >
> > STDMETHODIMP CJon::DoIt() {
> >   CAspPtr<IResponse> spResponse;
> >   if( spResponse ) {
> >     spResponse->Write(CComVariant(OLESTR("Baby got
> > <b><i>Response</i></b>.")));
> >   }
> >   return S_OK;
> > }
> >
> > CAspPtr is available at
> > http://www.sellsbrothers.com/tools/index.htm#aspptr.
> > Enjoy.
> >
> > Chris Sells
> > http://www.sellsbrothers.com

----------------------------------------------------------------
Users Guide http://www.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://discuss.microsoft.com/archives/index.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic