I have a control, call it MyControl.ocx. It therefore has a type library, MyControl.tlb.
I can use VC 6's ClassWizard to create wrapper classes for that type library, which is great - but since this control of mine is still in development (I'm experimenting, and testing the control as I go), the contents often change and thus I would need to keep recreating it - deleting the old files first, probably. If I use this method, I can declare and use objects of type _DMyControl with no problems. So I was trying to use something new (to me): #import. The import itself, and the creation of the .tlh and .tli files, went OK; but I'm struggling to be able to declare and use the object wrapping the type library. Looking in the .tlh, it declares structs. One is _DMyControl, derived from IDispatch, which sounds familiar; the other is plain MyControl. If I try to declare and use a MyControl object, the compiler complains of "... uses undefined type MyControl" (it is a forward reference only, no body). If I try to declare and use a _DMyControl object, it complains of "... cannot instantiate abstract class _DMyControl because of..." and then it lists functions such as QueryInterface(), AddRef(), etc. So based on the name MyControl.tlb, what class should I be declaring my objects as? The ClassWizard method gives me something derived from COleDispatchDriver, which allows me to use AttachDispatch() to connect an IDispatch to (some members may remember a question from a while back about one control using another). If I could just figure out how to use #import's results properly I think I'd be onto a winner. -- Jason Teagle [EMAIL PROTECTED]
