Microsoft KB Archive/214442

= FIX: Incorrect Prototype in ClassWizard CRecordset::Move Override =

Article ID: 214442

Article Last Modified on 11/18/2003

-

APPLIES TO


 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition

-



This article was previously published under Q214442



SYMPTOMS
When you use the ClassWizard to generate an override for the Move virtual method in a CRecordset derived class, the prototype provided is incorrect.

This produces a new virtual function, not an override for the Move method specified in the base class. As a result, whenever the Move function is called through a pointer to the base class (CRecordset) the generated Move function that the developer expects to override the base class Move) is ignored, and the base class Move is called instead.



RESOLUTION
Manually edit the generated text or do not use the ClassWizard.

The generated text is:

class CMyRecordset : public CRecordset { // [...]   //AFX_VIRTUAL // [...] }; Edit as follows:

class CMyRecordset : public CRecordset { // [...]   //AFX_VIRTUAL // [...] };

You need to make similar changes in the implementation file for CMyRecordset::Move.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This problem was corrected in Microsoft Visual C++ .NET.



Steps to Reproduce Behavior

 * 1) Create a new MFC project with any level of database support.
 * 2) Use ClassWizard to add a new class, CMyRecordset derived from CRecordset.
 * 3) Right-click on the new class in ClassView and click Add virtual function. Click Move.

RESULT: Look in the header file and the implementation file for the generated class. The prototype used for Move is not correct.

Keywords: kbbug kbfix kbnoupdate kbdatabase kbwizard KB214442

-

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

© Microsoft Corporation. All rights reserved.