FIX: GPF Using ATL Control Array and Accelerator Key (203230)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
This article was previously published under Q203230 SYMPTOMS
You write an ATL control and the TranslateAccelerator of the control calls the TranslateAccelerator on its control site for further processing. You put an array of this control on the Visual Basic form. Then, you put a CommandButton with the Cancel property set to True and unload the form in the Click event of the CommandButton. You run the application in the Visual Basic integrated development environment (IDE). You press the Esc key when the focus is on one of the ATL controls and the form loads. If you run the application again, you get a general protection fault (GPF).
This only happens in the Visual Basic 5.0 IDE. It does not occur if you run the application as a standalone .exe or if you run it in the Visual Basic 6.0 IDE.
CAUSE
When the control site is released, the control array is destroyed before the ATL control finished processing.
RESOLUTION
There is currently no known workaround for the Visual Basic 5.0 IDE. Microsoft recommends that programmers do not unload the form while the focus is on the ATL control array.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Visual Basic 6.0.
Modification Type: | Major | Last Reviewed: | 11/18/2003 |
---|
Keywords: | kbBug kbCtrlCreate kbfix kbVBp600fix KB203230 |
---|
|