tags:

views:

784

answers:

1

I have a COM object written using the MS ATL library. I have declared a bunch of enumerations in the IDL but they do NOT appear when viewing the type library using the MS COM Object Viewer tool. The problem seems to be that the missing enums are not actually used as parameters by any of the COM methods - how can I force these enums to appear?

For example, in the IDL:

// Used by Foo method, so appears in the type library
typedef enum FOO
{
    FOO_1,
    FOO_2,
} FOO;

// Not used by any method, so won't appear in the type library
typedef enum BAR
{
    BAR_1,
    BAR_2,
} BAR;

[id(1)] HRESULT Foo([in] FOO eFoo);

Even though the enums in question aren't directly used by any methods, they will still be useful to anyone using the object, but I can't get them to export.

Has anyone seen this before?

+2  A: 

Did you put them in the library section of the IDL? Only types mentioned in the library section go into the TLB.

library MyLib {
    // ...
    enum BAR;
Motti
That did the trick! Thankyou.
Rob
Good to hear. What do you know, StackOverflow actually helps people find help! :o)
Motti