How to detect whether a control is standard or act

2019-06-03 16:21发布

问题:

In MFC Application, how can we differentiate whether a control is a standard control like CComboBox or it is an custom active-x control?

回答1:

You can use CWnd::GetControlUnknown:

Return Value

A pointer to the IUnknown interface of the OLE control represented by this CWnd object. If this object does not represent an OLE control, the return value is NULL.