Microsoft KB Archive/174891

= FIX: CComQIPtr operator= Causes an Access Violation =

Article ID: 174891

Article Last Modified on 10/2/2003

-

APPLIES TO


 * Microsoft ActiveX Template Library 2.0
 * Microsoft ActiveX Template Library 2.1

-



This article was previously published under Q174891



SYMPTOMS
When a CComQIPtr is assigned a NULL pointer, an access violation occurs.



CAUSE
When a CComQIPtr is assigned a NULL pointer, no check is done, and a QueryInterface is attempted with the NULL pointer. This behavior causes the access violation.



RESOLUTION
Do not assign NULL pointer to a CComQIPtr object.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual Studio 97 Service Pack 3.

For more information, please see the following article in the Microsoft Knowledge Base:

170365 INFO: Visual Studio 97 Service Packs - What, Where, and Why



Steps to Reproduce Behavior
CComQIPtr ptr; IUnknown* pUnk = NULL; ptr = pUnk; (c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Chuck Bell, Microsoft Corporation

Keywords: kbbug kbfix kbvs97sp2fix kbatl300fix kbarchitecture KB174891

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.