CDK 16-Bit OCX Loaded in Memory on Windows Exit Hangs MachineLast reviewed: April 4, 1996Article ID: Q149531 |
The information in this article applies to:
SYMPTOMSIf you have any .OCX, .VBX, or .DLL that was created by the Control Developer's Kit (CDK) loaded in memory when you exit Windows 3.1, Windows will hang trying to call the WEP in the .OCX. Visual Basic 3.0 or 4.0 (16-bit) application contains a control created by the CDK (for example, CIRC3). When the application is still running, and you exit Windows 3.1, the system hangs.
CAUSEThe cause of this hanging is that the CDK-provided WEP calls into other .DLLs. During Windows shutdown, those .DLLs may have already been unloaded.
STATUSMicrosoft has confirmed this to be a problem in the 16-bit version of the Control Development Kit.
WORKAROUNDThe solution is for the control to implement a custom WEP and only call the CDK's WEP when Windows isn't shutting down. In the case where Windows is shutting down, the control's custom WEP shouldn't do anything. The following code may be used as a control's custom WEP procedure. Place these statements in the main .CPP file of the control. For example, CIRC3.CPP.
extern "C" int CALLBACK WEP(int); extern "C" int CALLBACK CTLWEP(int nExitType) { if (nExitType == WEP_SYSTEM_EXIT) return 0; return WEP(nExitType); }In the 16-bit .DEF file (for example, CIRC3.DEF), change the following line
WEP @1 RESIDENTNAME to: WEP=CTLWEP @1 RESIDENTNAME MORE INFORMATIONThis is a problem with how the CDK has implemented their WEP. For end users, this will happen if they try to exit Windows with an application that has a CDK .OCX, .VBX, or .DLL loaded.
|
Additional reference words: 4.00 vb4win vb416 3.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |