I am having problems using the public enum defined in C # in the C ++ interface. The .NET project works with COM, which will be used in C ++ and VB 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 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 indicating
Except for the type specification near TestEnum
I guess I'm doing something wrong. MethodOne seems to find the link correctly.
Is there any magic for referencing a .NET enum object in a C ++ interface?
c ++ enums c # com
Steve borgra
source share