I'd like to figure this out too. The closest I've come is to get VB6 to recognize it as an ActiveX control; the missing piece was adding the registry keys for the .NET control's type library (create a normal ActiveX control in C++ and see what it registers). Unfortunately when I try to reference the component VB barfs with a "mscoree.dll could not be loaded" messagebox. Oddly, I can call Form.Controls.Add("mylib.mycontrol","mycontrol1") and add the control at runtime with no problem. That approach has limitations, unfortunately, as it is late bound and doesn't allow much design time support. Also, it seems to hide the true interface for my control, ie accessing a property I know should be there returns the "object doesn't support this property" error. I can also reference my library (as opposed to referencing the Component) and create an early-bound instance of my control. Unfortunately, VB doesn't give me a way to add it to the form's controls list (or maybe I'm missing something, as I'm a C++ programmer mostly).
Also, I assume Microsoft had some reason for not supporting this feature; my guess is they had performance or stability problems and didn't have time to get it fixed for the final release. So, even if we figure out how to do this ourselves, there may be a more fundamental problem.
Hope that helps, Robert W. Grubbs |