A
Alan Sloan
I need to create a .net class library (dll) that contains nothing but a
bunch of constants. It doesn't matter if it's VB.NET or C#, but it must be
exposed to COM so that a legacy VB6 project can reference it and use the
constants contained within the dll.
Let's see if I can explain this clearly. I have created a C# dll which
contains several classes and within those classes are the constants. Such
as:
using System; namespace MyConstantLib {
public sealed class ItemConstants : CommonConstants
{
public static readonly Int32 CLASS_ITEM_BASE_CLASS = 901;
public static readonly Int32 CLASS_DOCUMENTS_CLASS = 9000;
public static readonly Int32 CLASS_DOCUMENT = 9141;
.....
}
The VB app can "See" and reference the DLL, and It will Intellisense all the
way to the class in the dll. For example, I can do this in VB
Dim dllRef as MyConstLib.ItemConstants
But I cannot get to the individual constants in the "object" (i.e.
CLASS_ITEM_BASE_CLASS const). What am I missing?
Even better yet would be that once my dll is referenced in VB these
constants would show up at the first level of the Intellisense list (right
there when you press ctrl+space) without needing to Dim an object to get to
them.
Any help would be greatly appreciated.
Thanks in advance,
Alan
bunch of constants. It doesn't matter if it's VB.NET or C#, but it must be
exposed to COM so that a legacy VB6 project can reference it and use the
constants contained within the dll.
Let's see if I can explain this clearly. I have created a C# dll which
contains several classes and within those classes are the constants. Such
as:
using System; namespace MyConstantLib {
public sealed class ItemConstants : CommonConstants
{
public static readonly Int32 CLASS_ITEM_BASE_CLASS = 901;
public static readonly Int32 CLASS_DOCUMENTS_CLASS = 9000;
public static readonly Int32 CLASS_DOCUMENT = 9141;
.....
}
The VB app can "See" and reference the DLL, and It will Intellisense all the
way to the class in the dll. For example, I can do this in VB
Dim dllRef as MyConstLib.ItemConstants
But I cannot get to the individual constants in the "object" (i.e.
CLASS_ITEM_BASE_CLASS const). What am I missing?
Even better yet would be that once my dll is referenced in VB these
constants would show up at the first level of the Intellisense list (right
there when you press ctrl+space) without needing to Dim an object to get to
them.
Any help would be greatly appreciated.
Thanks in advance,
Alan