FIX: SetNumProperty GP Faults with Some Property Array TypesLast reviewed: September 18, 1997Article ID: Q113533 |
1.00
WINDOWS
kbprg kbfixlist kbbuglist
The information in this article applies to:
SYMPTOMSUsing SetNumProperty or GetNumProperty on a property array that uses any of the following internal data types (internal to the VBX) causes a general protection (GP) fault or unexpected behavior:
DT_BOOL, DT_XPOS, DT_XSIZE, DT_YPOS, DT_YSIZE CAUSEThe VBX emulation layer used by the Microsoft Foundation Classes (MFC) incorrectly sets up the data structure pointer, which is passed to the VBX when any of these types are used for a property array.
STATUSMicrosoft has confirmed this to be a problem in MFC version 2.0. This problem was corrected in MFC version 2.5.
MORE INFORMATIONThis problem might have a variety of effects depending on the VBX. The specific problem is that when these types are used, the lp parameter (also known as lParam) passed to the VBX control procedure is set to -1. For property arrays, this parameter is supposed to be a pointer to a structure of type DATASTRUCT. Most VBXs will attempt to access this structure and when an attempt is made to dereference the pointer, a GP fault occurs. As an example, consider the following property declaration in the implementation of a VBX:
PROPINFO Property_TestBool = { "TestBool", DT_BOOL | PF_fPropArray | PF_fGetMsg | PF_fSetMsg | PF_fNoShow, OFFSETIN(CIRC,TestBool) };If an MFC application has a CVBControl pointer that points to a VBX with this property, and tries to set one of the elements in this DT_BOOL property array, a GP fault probably will result: ... CVBControl *pCtrl = (CVBControl *)GetDlgItem(IDC_CIRC1); pCtrl->SetNumProperty("TestBool",0,1); // This line will GP fault. ...
|
Additional reference words: 1.00 2.00 gpf gp-fault
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |