RECORDSET-> Release () or recordset.release () ?? [2004, 19:16]

zhaozj2021-02-16  64

Recordset-> release () or recordset.release () ??

What is the difference in "." And "->".

I haven't figured it out yet.

Just have such an intuition, the following ideas have not been confirmed, no one should use it!

Remembering from _RecordSetPtr's CreateInstance, it uses ".", So "." Is a relationship with COM object creation and destruction, and "->" is a call to another existing reference. From the principle of COM object

When the PTR uses AddRef, you need to use ".", Otherwise "-> ".

The effect of .release () is to reduce the count of COM.

And -> Release () is to set this PTR and do not reduce the count. Is it really? It doesn't seem like this when using MSXML, the call will be wrong, it seems to be in MSXML if the PTR is not null, until the end (destroyed ??) will automatically call Release () to cause an error.

The count in COM is really quick, released, which will cause other places to call errors, do not release, counting errors, and COM calls cannot release space. Say free to find

Reply: recordset-> Release () or recordset.release () ?? 2004-6-19 10:16 Carfield

It is called a smart pointer Release -> Calling is Iuknown's relese general not to call-> Release ()

转载请注明原文地址:https://www.9cbs.com/read-17196.html

New Post(0)