>I have been trying to automate various sorts of code creation. I have
> been using the TLI (TLBINF32.DLL) to query dlls for their contents.
[quoted text clipped - 12 lines]
> Thanks,
> Alok

Signature
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
On Jun 1, 3:26 pm, "Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com>
wrote:
> >I have been trying to automate various sorts of code creation. I have
> > been using the TLI (TLBINF32.DLL) to query dlls for their contents.
[quoted text clipped - 25 lines]
> Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
> In Loving Memory -http://www.vbsight.com/Remembrance.htm
This looks interesting.. on preliminary inspection, the event
interface detection happens in frmDocHelp.pbGetTypeLibInfo, on the
following lines:
iDefaultEvents
= .TypeInfos(iTypeInfo).DefaultEventInterface.TypeInfoNumber
If (Err.Number = 0) Then
m_tDefaults(iTypeInfo).iDefaultEvents = iDefaultEvents
+ 1
Else
m_tDefaults(iTypeInfo).iDefaultEvents = -1
End If
This is pretty clear in that it relies upon the DefaultEventInterface
property. Perhaps I am being paranoid worrying about other event
interfaces - here is my reasoning
1) Declaring things WithEvents is the only way to recieve events in VB
2) The only things that can be declared "WithEvents" are coclasses
3) The default event interface is the one that you listen to when you
declare something "WithEvents"
it logically follows
4) in order for an event interface to be accessed within vb, it must
be the DefaultEventInterface for some co-class.
Sound correct? It would still be nice to know if event interfaces are
marked in some special way- in a sense they must be, for how does
defaulteventinterface know which one to return?
Alok
Ken Halter - 01 Jun 2007 22:20 GMT
> it logically follows
>
[quoted text clipped - 6 lines]
>
> Alok
Well... I've never looked that closely. I imagine you can find that info in
a book called "Advanced Visual Basic 6", since it was written by a member of
the VB design team and the same guy's the one that wrote tlbinf32.dll, so,
if anyone knows, it's him. His email address is on the site below as well.
He used to post to these groups all the time, but has since moved on to
"bigger and better things" after leaving MS.
http://www.powervb.com/

Signature
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
Ralph - 02 Jun 2007 16:35 GMT
> << <snipped>
>
[quoted text clipped - 6 lines]
> marked in some special way- in a sense they must be, for how does
> defaulteventinterface know which one to return?
I second Ken's advice. Get the book.
As for the mystery of the *default*eventinterface. It helps to understand
that the idea of a "default" interface is kind of a VBish thing. eg. The
Public Interface presented by a VB Class is often called the "Default" - but
it is simply the one you get when you declare a reference to the class and
not to any other 'named' interface.
Events are supported by IConnectionPoint/s They are exposed through an
IConnectionPointContainer which contains two functions - FindConnectionPoint
and EnumConnectionPoints. The "default" is simply the first one or the only
one available.
When seeking a specific IConnectionPoint it's back to 'names' (your
'marks').
Naturally this is a 40,000 foot view.
hth
-ralph