CComPtr->Release() or CComPtr.Release() 
Author Message
 CComPtr->Release() or CComPtr.Release()

hi all,
i've notised that when ADO::Recordsed is used it is freed by rs->Release()
before getting out of scope.
why CComPtr has Release() at all and when rs->Release is called i thought
that it will be decremented 2 times? but this is McGRAW-HILL MCSD Visual C++
Distributed Applications Study Guide!
I thought we should call .Release instead?
regarding to CComPtr and _com_ptr_t .. where should release be used?


Tue, 10 Feb 2004 17:42:52 GMT  
 CComPtr->Release() or CComPtr.Release()
That's a mistake, and if this is a CCom[QI]Ptr pointer it won't compile with
ATL 3.0. The #import wrappers are dumber though, and this will compile
if it is a #import generated wrapper.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> hi all,
> i've notised that when ADO::Recordsed is used it is freed by rs->Release()
> before getting out of scope.
> why CComPtr has Release() at all and when rs->Release is called i thought
> that it will be decremented 2 times? but this is McGRAW-HILL MCSD Visual
C++
> Distributed Applications Study Guide!
> I thought we should call .Release instead?
> regarding to CComPtr and _com_ptr_t .. where should release be used?



Wed, 11 Feb 2004 04:47:41 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Cannot call Release for a CComPtr

2. Using CComPtr<>::CoCreateInstance

3. The difference between .Release and ->Release

4. Crash in CComPtr destructor

5. Possible to do without CComPtr here?

6. CComPtr question

7. How to use CComQIPtr and CComPtr in client.

8. CComObject and CComPtr

9. CComPtr and CMyObject causes exception...

10. CComPtr and _ATL_MIN_CRT

11. CComPtr without .h file

12. Problem is _onexit (atexit) and CComPtr

 

 
Powered by phpBB® Forum Software