Is there anyway to determine whether a dll is an ActiveX control or strictly a COM object?
See the question and my original answer on StackOverflowTo make it short, ActiveX was mostly a marketing term for COM.
ActiveX Controls are in general equipped with a type library, which is either embedded as a Win32 resource or provided as an external file (usually a .TLB file). A type library is not mandatory to work with COM but ActiveX controls where generally designed to support Internet Explorer and/or Visual Basic, MFC, etc.), languages or platforms that need some higher-level metadata to describe native objects and their methods.
You can visualize what a type library defines using the OleView tool from the Windows SDK.
For example, here is what it shows for the Remote Desktop Services ActiveX Client which is still provided today with Windows in mstscax.dll
(run oleview mstscax.dll
):
What you see in the (reconstructed) type library is the MsRdpClient2
coclass is an ActiveX control because it's marked with the control MIDL attribute.
So, what you can do is do the same as what OleView does, programmatically using the ITypeLib interface from LoadTypeLib and/or LoadRegTypeLib functions. A control will have the TYPEFLAG_FCONTROL, LIBFLAG_FCONTROL
flags as documented in the control
documententation.