I'm trying to expose a typedef from an assembly in a managed C++ code and
cannot seem to make it work. See following code below:
namespace MyTypedef
{
public __gc class MyClass
{
public:
bool b() {return true;}
};
typedef MyClass NewName;
}
When viewed from Idlasm.exe, all I see is MyClass. I cannot use the new
typedef NewName. It seems that NewName is not exposed. Is there a way to
expose it using some Extern keyword, etc. Some suggested that make NewName
to inherit from MyClass. This is not acceptable since this violates the need
to have typedef in the first place. Please help!
Ronald Laeremans [MSFT] - 29 Sep 2005 04:15 GMT
> I'm trying to expose a typedef from an assembly in a managed C++ code and
> cannot seem to make it work. See following code below:
[quoted text clipped - 15 lines]
> to inherit from MyClass. This is not acceptable since this violates the need
> to have typedef in the first place. Please help!
Typedefs are not exposable in metadata. You can use them inside the
assembly, but not outside.
Ronald Laeremans
Visual C++ team