Is it possible to expose a C# Enum to COM Interop callers, and if so, how?
My (so far only) .NET assembly that I made COM-visible also had an enum type, which showed up just fine in OleView. I had the whole library be COM-visible so
[ComVisible(true)]
was not necessary. Is your enum type public?
One thing that happened was that the different enumerations were 'prefixed' with 'enum type name'_:
public enum DataType
{
INT32,
FLOAT64,
INT8
}
turned into:
typedef [...]
enum {
DataType_INT32 = 0,
DataType_FLOAT64 = 1,
DataType_INT8 = 2
} DataType;
in the type library.
VBScript and other late-bound clients use IDispatch to call methods on objects. As such, these languages don't have access to type information in the typelib -- they just create an object from a GUID, get an IDispatch pointer back, and start calling methods by name.
I'm unsure of the COM interop part of the question, but even if the enums did show in OleView, you wouldn't be able to use them directly.
However, if you are able to publish the enums in the typelib, I wrote a tool eons ago that can generate a script file (vbs or js) containing all the enums from a typelib as constants.
See here: http://www.kontrollbehov.com/tools/tlb2const/