Your class declaration - private withevents myObj as MYEventClass - must be
inserted in a form or a class module. It doesn't work at all when
declaration stands in a bas module.
----- Original Message -----
From: Helen Warn <hwarn@h...>
To: professional vb <pro_vb@p...>
Sent: Sunday, January 14, 2001 10:16 PM
Subject: [pro_vb] Problem with Class Module
> Hi,
>
> I hope someone can help me with the following problem. There must be
> something simple I am missing.
>
> I have created a class module (MyEventfulClass) in VB6 that raises a few
> public events.
>
> When I try to declare a private variable with the following line in the
code
> behind a form:
>
> Private WithEvents myObj as MyEventfulClass
>
> I note that the class name does not show up in the list of available
> classes. However, if I declare it with the line
>
> Private myObj as MyEventfulClass
>
> then it shows up in the intellisense list of available classes, as
expected.
>
> Does anyone know what I need to do to be able to declare the variable and
> receive the events?
>
> Thanks,
>
> Helen
> Helen Warn, Ph.D. (xxx) xxx-xxxx
> E-Mail: <mailto:hwarn@h...>
>
>
>
>