Home All Groups Group Topic Archive Search About
Author
24 May 2005 1:31 PM
Peter Plumber
Just out of curiosity:

I am using the code below and noticed that in the collection the
function exposing the IUnknown is called [_NewEnum]
It ssems not to be possible to use names like [_NewEnum]
for userdefined functions. Or does anyone know how to do this?

thx

Peter


Public Property Get Items( _
         ) As IUnknown

     'Attribute Items.VB_UserMemId = -4
     'Attribute Items.VB_MemberFlags = "40"

     ' this property allows you to enumerate
     ' this collection with the For...Each syntax
     Set Items= m_colItems.[_NewEnum]

End Property

Author
24 May 2005 2:33 PM
alpine
On Tue, 24 May 2005 15:31:02 +0200, Peter Plumber
<Klemp***@gmxdot.net> wrote:

Show quoteHide quote
>Just out of curiosity:
>
>I am using the code below and noticed that in the collection the
>function exposing the IUnknown is called [_NewEnum]
>It ssems not to be possible to use names like [_NewEnum]
>for userdefined functions. Or does anyone know how to do this?
>
>thx
>
>Peter
>
>
>Public Property Get Items( _
>         ) As IUnknown
>
>     'Attribute Items.VB_UserMemId = -4
>     'Attribute Items.VB_MemberFlags = "40"
>
>     ' this property allows you to enumerate
>     ' this collection with the For...Each syntax
>     Set Items= m_colItems.[_NewEnum]
>
>End Property


First off, why would you want to?  It certainly makes the code less
readable.  If you have a good reason for doing so, you can alter the
typelib VB produces for a component to create hidden methods and such.
For more info, you would probably be best to consult Matt Curland's
Advanced VB6  book (www.powervb.com).

HTH,
Bryan
____________________________________________________________
New Vision Software                   "When the going gets weird,"
Bryan Stafford                      "the weird turn pro."
alpine_don'tsendspam@mvps.org     Hunter S. Thompson - 
Microsoft MVP-Visual Basic     Fear and Loathing in LasVegas