🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.multi-tier
Article #1381

Re: IProviderPtr vs. IProvider * : A related problem

#1381
From: Mark Brown
Date: Thu, 04 Nov 1999 00:00
32 lines
1565 bytes
Hi-

I found that if I changed the Connect interface method to accept an
IClientSinkPtr * variable instead of a IClientSinkPtr variable, I was
able to successfully get my code to work.

Interesting thing I found...While performing this cast (at the end of
code snip-it):

    CComPtr <IClientSink> mySinkPointer;
    CComObject <TClientSink> *Sink = new CComObject <TClientSink>;
    mySinkPointer = Sink;

   IClientSinkPtr *myClientSinkPtrPtr =
(IClientSinkPtr*)&mySinkPointer;   // <--This cast

an ASSERT error was raised in atlbase.h.  By just ignoring it, the
code worked fine.

Specifically, in lines 325-327:
  // The assert on operator& usually indicates a bug.  If this is
really
  // what is needed, however, take the address of the p member
explicitly.
  T** operator&() { _ASSERTE(p==NULL); return &p; }

Seems like this might be a bug, and should be (p!=NULL).

Comments?

Hope this helps,
Mark
Technical Details
Message-ID: <7vscn7$5tk5@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7vs48m$3ap7@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcd2b,b767dd993a659b8e
X-Google-Attributes: gidfcd2b,public
From: "Mark Brown" <mbrown@dsi-inc.net>
Subject: Re: IProviderPtr vs. IProvider * : A related problem
Date: 1999/11/04
Message-ID: <7vscn7$5tk5@forums.borland.com>
X-Deja-AN: 544446886
Content-Transfer-Encoding: 7bit
References: <7vs48m$3ap7@forums.borland.com>
Content-Type: text/plain; charset="iso-8859-1"
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.multi-tier