HOWTO: How to Access a Subclassed Windows Control in an OLE Control (135048)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC)
- Microsoft OLE Control Developer's Kit (CDK)
This article was previously published under Q135048 SUMMARY
The ControlWizard provided with the CDK allows a new OLE control to be
created by subclassing a common Windows control such as a button, toolbar,
or edit box. The XLIST sample provided with the CDK illustrates how to do
this by subclassing a Windows list box. The XLIST sample communicates with
and manipulates the subclassed Windows control by using the Windows
SendMessage() API. For example, to insert a string into the subclassed list
box, use this code:
SendMessage(LB_INSERTSTRING, nIndex, (long)lpstrText);
Because MFC provides wrapper classes for the common Windows controls, it
would be useful to be able to use these classes to communicate with the
subclassed control. This article illustrates one technique for doing this
by showing how to connect the appropriate MFC control class to the
COleControl-derived class that subclasses a Windows control.
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | kbCtrl kbhowto kbNoUpdate kbWndwProc KB135048 |
---|
|