Board index » delphi » Setting Collection.Item property default

Setting Collection.Item property default

Hello,

How do i make the Item property in my COM collection class the default
property (so that i can access it in VB using just "Collection(i)" instead
of "Collection.Item(i)"). Setting the "Default Collection Element" checkbox
in the property flags doesn't seem to have an effect. Should i use a special
DISPID, like _NewEnum?

Any comments appreciated... Thanx!

John

 

Re:Setting Collection.Item property default


Give it the dispid value of zero.

Ryan VanIderstine
Run-Time Systems
http://www.run-time-systems.com

Quote
John Petersen <jo...@post1.tele.dk> wrote in message

news:7pbtd5$sch6@forums.borland.com...
Quote
> Hello,

> How do i make the Item property in my COM collection class the default
> property (so that i can access it in VB using just "Collection(i)" instead
> of "Collection.Item(i)"). Setting the "Default Collection Element"
checkbox
> in the property flags doesn't seem to have an effect. Should i use a
special
> DISPID, like _NewEnum?

> Any comments appreciated... Thanx!

> John

Re:Setting Collection.Item property default


It worked.... Thankx! :-)

John

Ryan VanIderstine <r...@run-time-systems.com> skrev i en
nyhedsmeddelelse:7pbtvp$s...@forums.borland.com...

Quote
> Give it the dispid value of zero.

> Ryan VanIderstine
> Run-Time Systems
> http://www.run-time-systems.com

> John Petersen <jo...@post1.tele.dk> wrote in message
> news:7pbtd5$sch6@forums.borland.com...
> > Hello,

> > How do i make the Item property in my COM collection class the default
> > property (so that i can access it in VB using just "Collection(i)"
instead
> > of "Collection.Item(i)"). Setting the "Default Collection Element"
> checkbox
> > in the property flags doesn't seem to have an effect. Should i use a
> special
> > DISPID, like _NewEnum?

> > Any comments appreciated... Thanx!

> > John

Other Threads