D.4. Remote User-Defined Types

User-defined types (UDTs) have always been a powerful part of VB programming. Their use, however, diminished slightly with the introduction of the Collection object in VB4. VB6 has redressed the balance by allowing you to define a public property or function that returns a UDT, or to use a UDT as an argument in a public function. This means that you can pass around strongly typed complex data structures, as opposed to passing around objects.

To go along with this change, UDTs can now also be used with the TypeName function and the TypeOf operator, and a new variable type constant, vbUserDefinedType, has also been added to the language.

Note that because the use of remote UDTs has required a change to the underlying COM/Automation structure, to use remote UDTs you must apply NT4 service pack 4, the latest version of DCOM95 (DCOM98), or be running on either NT5 or Windows 98.

For information on how to use remote UDTs, see Reference entry "Type Statement" in Chapter 7 and Section 4.1.3 in Chapter 4.

Get VB & VBA in a Nutshell: The Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.