Hello everyone,

I'm working with VB6 and I have imported a type library into my project. I've run into an issue where I cannot use fully qualified names for enum values, even though the enums are defined in my type library. Here's what I've done:

Type Library Definition (.IDL File):
Code:
import "oaidl.idl";
[uuid(3869b3c3-8849-45a0-a337-bab659c42363), version(1.0)] library mylib
{
typedef [v1_enum] enum {
    MB_NONE = -1,
    MB_LEFT = 1,
    MB_LEFTDOUBLE = 2,
    MB_RIGHT = 3,
} eMouseButtons;

typedef [v1_enum] enum {
    BT_BalloonTopic_NONE = 0,
    BT_CLICKTOPURCHASEBOOK = 1,
    BT_SPACENOTNECESSARY = 2,
    BT_THIRDDOTNOTNECESSARY = 3,
} eBalloonTopic;
}
Compiling and Registering the Type Library:
I compiled the IDL file with midl to produce mylib.tlb and then registered it using regtlib.exe.

Using the Type Library in VB6:
After adding a reference to mylib.tlb in my VB6 project, I tried to declare and use the enum values. Here is the code snippet:

Code:
Dim i As mylib.eMouseButtons
i = MB_DRAGDROP_DROP 'This works, but it's not fully qualified.

'However, these do not work:
i = mylib.eMouseButtons.MB_DRAGDROP_DROP 'Error: does not work.
i = eMouseButtons.MB_DRAGDROP_DROP 'Error: does not work.
Problem:
I would like to use the fully qualified names for enum values to avoid potential naming conflicts and for better code clarity. However, VB6 does not seem to recognize the enum type as a qualifier for the enum values.

Questions:

Is there a way to use fully qualified enum names in VB6 when using a type library?
If not, what are the best practices to handle similar situations where name clashes might occur due to global scope enums?
Any help or guidance would be greatly appreciated!