Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / October 2007



Tip: Looking for answers? Try searching our database.

COM-Inspection (enumerate earlybound references)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alexander Mueller - 05 Oct 2007 09:55 GMT
Hi

I'd like to know if and how it is possible to
enumerate all the early-binding refernces of
a VB-DLL?
Especially i need to know whether an MS-Outlook
OLB is early bound into the DLL and if so,
which version of OUTLOOK-olb.

Thanks for any help.

MfG,
Alex
mayayana - 05 Oct 2007 14:13 GMT
> I'd like to know if and how it is possible to
> enumerate all the early-binding refernces of
[quoted text clipped - 4 lines]
>
> Thanks for any help.

 Assuming that you're still working on your object
browser, and that you're filtering Typekinds 4 and
5 in your enumeration of TypeInfos (to get Dispatch
interfaces and creatable objects) I think you can just
add Typekind 3 to that filter for early-bound interfaces.

3 TKIND_INTERFACE
4 TKIND_DISPATCH
5 TKIND_COCLASS

From tlbinf32.chm:

3 TKIND_INTERFACE - Description of an IUnknown derived vtable.

If you have the help file, look up Typekinds.

 In practice, nearly all COM objects seem to have
dual interfaces, supporting both early and late
binding. The only exception I can think of that I've
come across is msi.dll, which has only a dispatch
interface for some reason. (I suppose MS didn't
want VBers mucking around in there. There's a
fullscale C++ API and a full scripting automation
object model, but that's it.)

  I'm not entirely clear about the structure of the
two interfaces, but it seems to me that early binding
comes first and making it dual is an option. According
to the book "The Essence of COM", concerning the
creation of a dual interface:
"You do this by deriving your custom VTBL interface
fromIDispatch rather than IUnknown, and specifying
the IDL attribute dual."

   I may be wrong in my understanding, but that seems
to be saying that the way to have late binding is by
adding the IDispatch interface methods in between the
IUnknown and the beginning of the vTable. So the
implication seems to be that MS had to actually go to
some kind of extra effort to avoid exposing the vTable.

 Maybe someone else has a more complete explanation
of how that all fits together.
Steve Gerrard - 05 Oct 2007 16:27 GMT
>    I may be wrong in my understanding, but that seems
> to be saying that the way to have late binding is by
[quoted text clipped - 5 lines]
>  Maybe someone else has a more complete explanation
> of how that all fits together.

I suspect that on a matter such as this, none of us really knows, but I think
you are right, adding IDispatch, and an implementation of it, is optional. I
would think that not having early binding could be accomplished by simply not
exporting any methods, i.e. not having any externally public methods. Building a
dll with no methods that can be called directly, in other words. If you then add
IDispatch, you have a late binding only dll.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.