Skip to Content
COM+ Programming with Visual Basic
book

COM+ Programming with Visual Basic

by Jose Mojica
June 2001
Intermediate to advanced
368 pages
11h 3m
English
O'Reilly Media, Inc.
Content preview from COM+ Programming with Visual Basic

Using IDL

If you believe, as I do, that VB’s versioning scheme is more trouble than it is worth, a better way to gain complete control over GUIDs is to define your interfaces with the Interface Definition Language (IDL). Defining your interfaces in IDL has several advantages:

  • You eliminate the overhead of having a class for each interface in a VB project.

  • You have complete control over when GUIDs change and why.

  • If you use IDL and use CreateObject in your client code (for reasons that will be obvious shortly), then you can set the versioning setting in VB to anything you wish and it will not affect whether the clients work or not.

The only disadvantage in using IDL is that you have to learn how to use it, and for some reason VB developers shy away from it.

You learned about IDL in Chapter 4. IDL is not a full language in the sense that it does not allow you to write loops or have if...then...else statements and so on. IDL is a syntax language for defining interfaces. IDL enables you to build standalone type library files. Once you define your interface in IDL, you can compile it with MIDL, the Microsoft IDL compiler. MIDL can produce a variety of files, including header files for C++ clients, proxy-stub code for standard marshalers, and, most importantly for us, a standalone type library file. It would be impossible for me to show you every aspect of IDL in this section of the chapter, so I am going to show you the essentials for building a type library in IDL.

Reverse-Engineering Type ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Subclassing and Hooking with Visual Basic

Subclassing and Hooking with Visual Basic

Stephen Teilhet
VB .NET Language in a Nutshell

VB .NET Language in a Nutshell

Steven Roman PhD, Ron Petrusha, Paul Lomax
Programming in the .NET Environment

Programming in the .NET Environment

Damien Watkins, Mark Hammond, Brad Abrams

Publisher Resources

ISBN: 1565928407Supplemental ContentCatalog PageErrata