I'm having issues using a public enum defined in C# within a C++ Interface. The .NET project is exposed to COM to be used within C++ and VB legacy software.
C# Code:
namespace ACME.XXX.XXX.XXX.Interfaces.Object
{
[Guid(".....")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
[ComVisible(true)]
public interface TestInterface
{
void Stub();
}
[ComVisible(true)]
public enum TestEnum
{
a = 1,
b = 2
}
}
C++ Code:
Edit: In the idl for the project I imported the tlb. (importlib("\..\ACME.XXX.XXX.XXX.Interfaces.tlb"))
interface ITestObject : IDispatch
{
[id(1), helpstring("one")]
HRESULT MethodOne([in] TestInterface *a);
[id(2), helpstring("two")]
HRESULT MethodTwo([in] TestEnum a);
}
In MethodTwo, I keep getting errors stating
Excepting Type Specification near TestEnum
I'm assuming there's something I'm not doing correctly. MethodOne seems to be finding the reference correctly.
Is there some magic to referencing .NET enum object in C++ interface?