The information in this article applies to:
SYMPTOMSWhen building an ActiveX control (OLE Control) using Visual C++ prior to version 5.0, you may receive the following error message: With Visual C++ 5.00, no compiler error is generated when building the control. However, both the CAUSE and RESOLUTION sections below still apply. CAUSEThis error occurs when using the Developer Studio or Class Wizard to add a WM_CLOSE message handler to your ColeControl-derived class. The handler created will have the following format:
However, an ActiveX Control is a COM object and, as such, uses a different
mechanism than processing a WM_CLOSE message to close down its window. For
this reason, COleControl has overridden OnClose with its own version using
the following prototype:
COleControl::OnClose has one parameter that is the reason for the error
message.
RESOLUTION
Because the ActiveX Control doesn't handle the WM_CLOSE message, if you
want to do some processing when the OLE control is terminating, you can
override the COleControl::OnClose function as follows:
To replace CEdt_on_ctrlCtrl with the name of your OLE control class, add
the following implementation in the .cpp file:
STATUSThis behavior is by design. Additional query words:
Keywords : kberrmsg kbole kbCtrl kbMFC kbVC200 kbVC210 kbVC220 kbVC400 kbVC410 kbVC500 |
Last Reviewed: January 31, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |