Why do enums vanish when my tlb file is imported using ClassWizard?
-
I have a VC 6.0 SP3 App Wizard generated dll. In the dll's type library I added an enum. The enumerated type is used as an argument in a ClassWizard Generated method. I just changed the return value to be my enum. The basic layout of the odl is below. [ uuid(...), helpstring(...), version(1.0) ] library MyLib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); typedef [uuid(...), v1_enum, helpstring(...)] enum MyEnum { [helpstring(...)] val1 = 1, [helpstring(...)] val2 }MyEnum; [ uuid(...) ] dispinterface MyInterface { properties: //{{AFX_ODL_PROP(CMyInterface) [id(1)] MyEnum TheType; //}}AFX_ODL_PROP methods: //{{AFX_ODL_METHOD(CMyInterface) //}}AFX_ODL_METHOD }; //{{AFX_APPEND_ODL}} //}}AFX_APPEND_ODL}} }; When I compile the dll it compiles cleanly and I can see my enum using the OLE-COM object viewer, and if I use the dll in VB I also can see the enumeration, and if I #import the tlb file the enumerations are properly declared. The problem is when I try importing the dll into another appwizard generated exe using ClassWizard. When I do this all my interfaces are imported but ClassWizard ignores the enums I have declared. Is there anyway to get my enums to be declared in the ClassWizard generated class files or do I have to do it myself. Simply importing the tlb is not an option at this point because I would have to rewrite too much of the existing application I am using my dll in.