Microsoft KB Archive/87636

= You receive a &quot;C2660&quot; error code when you call a Windows API from within a member function of a window class =

Article ID: 87636

Article Last Modified on 1/7/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 6.0 Enterprise Edition

 Microsoft Visual C++ 6.0 Professional Edition

 Microsoft Visual C++ 5.0 Learning Edition

 Microsoft Visual C++ 2005 Express Edition</li></ul>

 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 Q87636

<div class="notice_section">

<div class="symptoms_section">

SYMPTOMS
When using the Microsoft Foundation Classes (MFC), the following error may occur when making a Windows application programming interface (API) call from within a member function of a window class: <pre class="fixed_text">  C2660: 'function' : function does not take 'number' parameters

<div class="cause_section">

CAUSE
Many of the Windows API calls are accessed in the Microsoft Foundation Classes through member functions of the same name as the API calls. This means that the name will be recognized, but because most member functions require fewer parameters than their API counterparts, the C2660 error occurs.

<div class="resolution_section">

RESOLUTION
Either of the following two methods eliminates the error:   Adjust the function call to conform to the format of the member: function call.

-or- </li> Use the scope resolution operator to tell the compiler to look for the function name in the global name space.</li></ul>

Keywords: kbprb KB87636

-

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

© Microsoft Corporation. All rights reserved.