Collection Problem 
Author Message
 Collection Problem

I have created a collection using the VB 6.0 (SP 5) Class Builder Wizard.
My NewEnum property looks like this...

Public Property Get NewEnum() As IUnknown
    'this property allows you to enumerate
    'this collection with the For...Each syntax
    Set NewEnum = mCol.[_NewEnum]
 End Property

When I try to compile I get "User-Defined Type Not Defined"

What am I doing wring, am I missing a reference or what?



Sat, 28 Aug 2004 09:54:07 GMT  
 Collection Problem
Did you set the Procedure ID = -4 from Tools->Procedure
Atributes...->Advanced?


Quote:
> I have created a collection using the VB 6.0 (SP 5) Class Builder Wizard.
> My NewEnum property looks like this...

> Public Property Get NewEnum() As IUnknown
>     'this property allows you to enumerate
>     'this collection with the For...Each syntax
>     Set NewEnum = mCol.[_NewEnum]
>  End Property

> When I try to compile I get "User-Defined Type Not Defined"

> What am I doing wring, am I missing a reference or what?



Sat, 28 Aug 2004 19:59:49 GMT  
 Collection Problem
Charles...

Take a look at this article...

http://www.devx.com/upload/free/features/vbpj/2002/03mar02/bb0302/bb0...
sp

Dag.


Quote:
> Did you set the Procedure ID = -4 from Tools->Procedure
> Atributes...->Advanced?



> > I have created a collection using the VB 6.0 (SP 5) Class Builder
Wizard.
> > My NewEnum property looks like this...

> > Public Property Get NewEnum() As IUnknown
> >     'this property allows you to enumerate
> >     'this collection with the For...Each syntax
> >     Set NewEnum = mCol.[_NewEnum]
> >  End Property

> > When I try to compile I get "User-Defined Type Not Defined"

> > What am I doing wring, am I missing a reference or what?



Sat, 28 Aug 2004 20:43:19 GMT  
 Collection Problem
Yes, I did but it doesn't make a difference.  This is my first collection so
I may be doing something whacko.   I created a cContract object, the project
compiles just fine.  I create a cContracts collection and set the Procedure
ID and suddenly, it will not long compile.
I am using the wizard to create the class and the collection.

Any other thoughts?


Quote:
> Did you set the Procedure ID = -4 from Tools->Procedure
> Atributes...->Advanced?



> > I have created a collection using the VB 6.0 (SP 5) Class Builder
Wizard.
> > My NewEnum property looks like this...

> > Public Property Get NewEnum() As IUnknown
> >     'this property allows you to enumerate
> >     'this collection with the For...Each syntax
> >     Set NewEnum = mCol.[_NewEnum]
> >  End Property

> > When I try to compile I get "User-Defined Type Not Defined"

> > What am I doing wring, am I missing a reference or what?



Sun, 29 Aug 2004 05:45:04 GMT  
 Collection Problem
Thanks fo rthe help Dag,  unfortunately I am still making no headway,  I
have followed the article to the "T".  but as soon as I add the collection,
the project no longer compiles.  (yes I an change the procedure ID to -4 and
hiding NEWENUM.

Any other thoughts?


Quote:
> Charles...

> Take a look at this article...

http://www.devx.com/upload/free/features/vbpj/2002/03mar02/bb0302/bb0...
Quote:
> sp

> Dag.



> > Did you set the Procedure ID = -4 from Tools->Procedure
> > Atributes...->Advanced?



> > > I have created a collection using the VB 6.0 (SP 5) Class Builder
> Wizard.
> > > My NewEnum property looks like this...

> > > Public Property Get NewEnum() As IUnknown
> > >     'this property allows you to enumerate
> > >     'this collection with the For...Each syntax
> > >     Set NewEnum = mCol.[_NewEnum]
> > >  End Property

> > > When I try to compile I get "User-Defined Type Not Defined"

> > > What am I doing wring, am I missing a reference or what?



Sun, 29 Aug 2004 05:47:25 GMT  
 Collection Problem

Quote:

> I have created a collection using the VB 6.0 (SP 5) Class Builder Wizard.
> My NewEnum property looks like this...

> Public Property Get NewEnum() As IUnknown
>     'this property allows you to enumerate
>     'this collection with the For...Each syntax
>     Set NewEnum = mCol.[_NewEnum]
>  End Property

> When I try to compile I get "User-Defined Type Not Defined"

> What am I doing wring, am I missing a reference or what?

Make sure you have a Project / Reference to "OLE Automation", a/k/a
StdOle.TLB.

--
Joe Foster <mailto:jlfoster%40znet.com>  "Regged" again? <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Sun, 29 Aug 2004 10:37:20 GMT  
 Collection Problem
Joe,

    Thanks, that was it.

CL




Quote:

> > I have created a collection using the VB 6.0 (SP 5) Class Builder
Wizard.
> > My NewEnum property looks like this...

> > Public Property Get NewEnum() As IUnknown
> >     'this property allows you to enumerate
> >     'this collection with the For...Each syntax
> >     Set NewEnum = mCol.[_NewEnum]
> >  End Property

> > When I try to compile I get "User-Defined Type Not Defined"

> > What am I doing wring, am I missing a reference or what?

> Make sure you have a Project / Reference to "OLE Automation", a/k/a
> StdOle.TLB.

> --
> Joe Foster <mailto:jlfoster%40znet.com>  "Regged" again?

<http://www.xenu.net/>

- Show quoted text -

Quote:
> WARNING: I cannot be held responsible for the above        They're
coming  to
> because  my cats have  apparently  learned to type.        take me away,
ha ha!



Sun, 29 Aug 2004 11:42:17 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. collection problem

2. Links Collection Problem

3. hyper links collection problem?

4. collection problems...

5. Collection Problem

6. Collection Problem

7. Collection Problem - Possible Bug?

8. Collection Problem

9. classes and collection problem

10. rdoConnection's rdoTables collection problem?

11. VB4-32 / Access 2.0 - Fields Collection Problem

12. Forms collection problem

 

 
Powered by phpBB® Forum Software