Can I create an instance of my control with Visual Basics CreateObject function?
Visual Basic’s CreateObject function creates an instance of an OLE automation server. It uses the standard COM APIs to create the instance and then query for the server’s IDispatch. OLE controls are automation servers, however, they also implement a number of other OLE interfaces, and really expect to be active within a container. The primary difference between a standard automation server and an OLE control is that the control natively supports events and provides a persistence mechanism for its properties (through its container). So, by default a control expects to have a control site containing various interfaces, but CreateObject cannot provide these. COleControl does, however, provide a way for a control to behave as just an automation controller. All you have to do is override COleControl::IsInvokeAllowed and return TRUE. This will allow you to CreateObject on your control, although you must be sure that everything will still work without any persistence support. You can check fo