Re: Why Compiler Const Error when no Compiler Const exists
- From: "Michael D. Ober" <mdo.@.wakeassoc..com>
- Date: Mon, 16 May 2005 11:00:18 -0600
The VB6 compiler can't tell the two eNone enumerations apart. This is a
design bug in the compiler. The workaround is to prefix all enumeration
values with a unique (to the enum statement) prefix.
Mike Ober.
"thejamie" <thejamie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9CCDD42F-27CC-48AA-8A8D-F3CAC148169B@xxxxxxxxxxxxxxxx
> It may be the enumerated constants. I moved some around and made one
> particular set Public since I use it in many places throughout the
program.
> When I make it a public rather than a private enumerator set, the error
> returns.
>
> Example:
> Public Enum MyEnum
> eNone
> eOne
> End Enum
>
> In another module
> Public Enum MyOtherEnum
> eNone
> eSomethingElse
> End Enum
>
>
>
> --
> Regards,
> Jamie
>
>
> "MikeD" wrote:
>
> >
> > "thejamie" <thejamie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > news:EF318380-9038-4737-8086-072EFE43BCD3@xxxxxxxxxxxxxxxx
> > > Bob,
> > >
> > > Version VB6 SP6.
> > >
> > > Error is straightforward:
> > > Modal header is "Microsoft Visual Basic"
> > >
> > > Message is "DUPLICATE DEFINITION"
> > >
> > > the message provides an OK and HELP option.
> > >
> > > I click OK and tried to open the program again - got the same message.
> > This
> > > happened after a compile.
> > >
> >
> > You most likely have 2 procedures of the same name and within the same
> > scope. Since VB can't determine which one you intended to call, it
raises a
> > duplicate definition error. Search your project for the procedure and
limit
> > the scope of one of the procedures, or if the procedures are actually
> > identical, eliminate of them.
> >
> > Mike
> >
> >
> >
>
.
- Follow-Ups:
- References:
- Re: Why Compiler Const Error when no Compiler Const exists
- From: thejamie
- Re: Why Compiler Const Error when no Compiler Const exists
- Prev by Date: Re: Determining my IP address
- Next by Date: Re: Problem with reference to an ActiveX exe file
- Previous by thread: Re: Why Compiler Const Error when no Compiler Const exists
- Next by thread: Re: Why Compiler Const Error when no Compiler Const exists
- Index(es):
Relevant Pages
|