Microsoft KB Archive/194862

= PRB: "QueryInterface:function does not take 1 parameters" Error =

Article ID: 194862

Article Last Modified on 9/22/2003

-

APPLIES TO

 Microsoft ActiveX Template Library 3.0, when used with:  Microsoft Visual C++ 6.0 Enterprise Edition

 Microsoft Visual C++ 6.0 Professional Edition

 Microsoft Visual C++ 6.0 Standard Edition

 Microsoft Visual C++ .NET 2003 Standard Edition</li></ul>

 Microsoft Visual C++ .NET 2002 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q194862

<div class="symptoms_section">

SYMPTOMS
When you build an ATL project, you may get the following compiler error:

c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(3331) : error C2660: 'QueryInterface' : function does not take 1 parameters

<div class="cause_section">

CAUSE
In Visual C++ 6.0, a templated version of QueryInterface, which takes one parameter (instead of the usual two), was added to IUnknown. In ATL 3.0, CComTypeInfoHolder::GetTI uses this templated version of QueryInterface. If you have an older version of Unknwn.h in your Include path, you get this compiler error. For example, having the Platform SDK Include directory in front of the \VC98\Include directory causes this problem.

<div class="resolution_section">

RESOLUTION
Replace the Unknwn.h in the other Include directory with the one from the Visual C++ 6.0 Include directory.

<div class="status_section">

STATUS
This behavior is by design.

<div class="references_section">