bug in MFC 4.1
Paul B -- Paul.B.Folbrecht@JCI.Com Monday, February 24, 1997 Environment: VC++ 4.1, Win95/NT I believe I've located a bug in MFC 4.1. It's probably already been fixed but I'll check. In the function void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, short& value) defined on line 205 of dlgdata.cpp, a format specifier is passed to DDX_TextWithFormat- "%d". This needs to be "%sd", because, the way it stands, AfxSimpleScanf(), which is eventually called by this routine, thinks the short passed to it is a 4 byte int and writes 4 bytes to it. I discovered this bug by using ClassWizard to associate a variable of type short with an edit control's value. -Paul Folbrecht Compuware Corp.
Dan Kirby -- dkirby@accessone.com Wednesday, February 26, 1997 This was fixed in 4.2. --dan ---------- > From: Paul.B.Folbrecht@JCI.Com > To: mfc-l@netcom.com > Subject: bug in MFC 4.1 > Date: Monday, February 24, 1997 10:00 AM > > Environment: VC++ 4.1, Win95/NT > > I believe I've located a bug in MFC 4.1. It's probably already been > fixed but I'll check. > > In the function > > void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, short& value) > > defined on line 205 of dlgdata.cpp, a format specifier is passed to > DDX_TextWithFormat- "%d". This needs to be "%sd", because, the way it > stands, AfxSimpleScanf(), which is eventually called by this routine, > thinks the short passed to it is a 4 byte int and writes 4 bytes to > it. > > I discovered this bug by using ClassWizard to associate a variable of > type short with an edit control's value. > > -Paul Folbrecht > Compuware Corp. >
Become an MFC-L member | Вернуться в корень Архива |