FIX: ClassWizard Overrides CDaoRecordset::Open IncorrectlyLast reviewed: September 19, 1997Article ID: Q153282 |
The information in this article applies to:
SYMPTOMSIf you override the CDaoRecordset::Open() function using ClassWizard, the new function will never be called.
CAUSEThe Wizard places an UINT type for the first parameter rather than an int. The code should read:
virtual void Open(int ...)rather than:
virtual void Open(UINT...) RESOLUTIONChange the type of the first parameter in your Open() function from UINT to int in the .h and .cpp files. STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++ version 4.2.
MORE INFORMATION
Sample CodeThe following sample code shows the correct function prototype for a CDaoRecordset-derived class named CMySet:
// CMySet.H: virtual void Open(int nOpenType = AFX_DAO_USE_DEFAULT_TYPE, LPCTSTR lpszSql = NULL, int nOptions = 0); // CMySet.CPP: void CMySet::Open(int nOpenType, LPCTSTR lpszSql, int nOptions) { // TODO: Add your specialized code here and/or call the base class CDaoRecordset::Open(nOpenType, lpszSql, nOptions); } Keywords : MfcDAO vcbuglist400 vcfixlist420 kbprg kbbuglist kbfixlist Technology : kbMfc Version : 4.00 4.10 Platform : NT WINDOWS Issue type : kbbug Solution Type : kbfix |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |