Article ID: 152391 - Last Review: December 2, 2003 - Revision: 2.0 PRB: Adding OnClose Handler to COleControl Class Causes C2660This article was previously published under Q152391 SYMPTOMS
When building an ActiveX control (OLE Control) using Visual C++ prior to
version 5.0, you may receive the following error message:
error C2660: 'OnClose' : function does not take 0 parameters
CAUSE
This 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:
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:
Add the following function prototype to the class definition in the header file for your COleControl derived class (in this example, CEdt_on_ctrlCtr): STATUS
This behavior is by design.
APPLIES TO
| Article Translations
|

Back to the top
