The information in this article applies to:
SYMPTOMSMemory adjacent to the BOOL variable gets overwritten when working with a BOOL CDaoRecordset field data member. CAUSEThe DFX_Bool function delegates the Fixup case to CDaoFieldExchange::Default and incorrectly passes AFX_RFX_LONGBINARY as the field data type. RESOLUTION
To resolve this problem, copy the DFX_Bool function to the project and give
it a different name. For example, rename it DFX_Bool2. In the call to
CDaoFieldExchange::Default, change the field data type from
AFX_RFX_LONGBINARY to AFX_RFX_BOOL by using the following code:
to this code:
Then, change the class of the CDaoRecordset-derived DoFieldExchange
function to call this new function in place of calling DFX_Bool.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ 32-bit Edition version 4.2. MORE INFORMATIONThe code for the Fixup case in CDaoFieldExchange::Default is:
The dwColumn type is the variable that is incorrectly set to
AFX_RFX_LONGBINARY in DFX_Bool. Note that SetNullValue is called with the
value passed in the second parameter. The code for SetNullValue (showing
relevant cases) is:
Note that the AFX_RFX_BOOL case (the one that should be called) sets the
BOOL variable to the constant AFX_RFX_BOOL_PSEUDO_NULL. The
AFX_RFX_LONGBINARY case (incorrectly called in the MFC source) sets the
m_dwDataLength member of a CLongBinary object (at an offset in the object
beyond the size of a BOOL) to zero. Whatever is adjacent to the BOOL
variable has 4 bytes of its memory overwritten. The symptoms of this memory
overwrite depend on what that variable was used for. There can also be no
symptoms.
Additional query words: kbVC400bug 4.00 4.10 4.20 vcfixlist420 MfcDAO
Keywords : kbDAO kbDatabase kbMFC kbVC |
Last Reviewed: January 31, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |