BUG: Incorrect Prototype in ClassWizard CRecordset::Move() OverrideID: Q214442
|
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.
Manually edit the generated text or do not use the ClassWizard.
The generated text is:
class CMyRecordset : public CRecordset
{ // [...]
//{{AFX_VIRTUAL(CMyRecordset)
public:
// [...]
virtual void Move(long lRows);
//}}AFX_VIRTUAL
// [...]
};
Edit as follows:
class CMyRecordset : public CRecordset
{ // [...]
//{{AFX_VIRTUAL(CMyRecordset)
public:
// [...]
virtual void Move(long lRows, WORD wFetchType = SQL_FETCH_RELATIVE);
//}}AFX_VIRTUAL
// [...]
};
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
Additional query words:
Keywords : kbwizard kbDatabase kbVC600bug
Version : winnt:6.0
Platform : winnt
Issue type : kbbug
Last Reviewed: March 3, 1999