S
ssamuel
I'm trying to create a drop-in replacement for an existing COM library
in C# 2.0. The original library is unmanaged and my consumers are
customers' VB6 legacy apps, many of which rely on global constants. As
..NET doesn't allow global constants, and I have no member name control
over enums, I'm having problems emitting IDL with constants the VB will
consume without extensive code modification. A C# enum that looks like
this:
namespace MyNS
{
public enum MyEnum
{
ValueOne = 1,
ValueTwo = 2
}
}
gives me this IDL in the DLL and through tlbexp.exe:
typedef [uuid(...), version(1.0), custom({...}, "MyNS.MyEnum")]
enum {
MyEnum_ValueOne = 0,
MyEnum_ValueTwo = 1
} MyEnum;
The COM export docs on MSDN clearly state this is by design to prevent
name collision. My legacy apps are looking for ValueOne, and they're
not finding it because I'm emitting MyEnum_ValueOne.
Has anyone solved this problem?
Thanks,
Stephan
in C# 2.0. The original library is unmanaged and my consumers are
customers' VB6 legacy apps, many of which rely on global constants. As
..NET doesn't allow global constants, and I have no member name control
over enums, I'm having problems emitting IDL with constants the VB will
consume without extensive code modification. A C# enum that looks like
this:
namespace MyNS
{
public enum MyEnum
{
ValueOne = 1,
ValueTwo = 2
}
}
gives me this IDL in the DLL and through tlbexp.exe:
typedef [uuid(...), version(1.0), custom({...}, "MyNS.MyEnum")]
enum {
MyEnum_ValueOne = 0,
MyEnum_ValueTwo = 1
} MyEnum;
The COM export docs on MSDN clearly state this is by design to prevent
name collision. My legacy apps are looking for ValueOne, and they're
not finding it because I'm emitting MyEnum_ValueOne.
Has anyone solved this problem?
Thanks,
Stephan