|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Hidden PropertyI 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 On Tue, 24 May 2005 15:31:02 +0200, Peter Plumber
<Klemp***@gmxdot.net> wrote: Show quoteHide quote >Just out of curiosity: First off, why would you want to? It certainly makes the code less> >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 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 |
|||||||||||||||||||||||