by Andrew W. Troelsen
|
Effective COM: 50 Ways to Improve Your COM and MTS-based Applications by Don Box |
by Dale Rogerson
|
by Al Major
|
by Chris Sells
|
All developers targeting the Compound Object Model (COM) need a working knowledge of the COM Interface Definition Language (IDL
All developers targeting the Compound Object Model (COM) need a working knowledge of the COM Interface Definition Language (IDL). IDL is a reasonably complex language and can be quite arcane, and acquiring a knowledge of it has been an uphill struggle. This book provides a comprehensive description of IDL and how to use it, making it accessible and understandable. It takes an example-based, top-down approach, laying out the various IDL constructs, why they exist, what they are for, and how and when to use them in interface definitions. In each case, example IDL is provided and, where applicable, source code is provided for client and object in C++ and Visual Basic. The source code examples are not intended to be cut and pasted into existing applications; rather, they illustrate particular points about IDL and its relationship to client and object implementations.
This is a book about COM IDL and hence does not cover IDL keywords, attributes, or other constructs that are usable only from standard Remote Procedure Call (RPC). In addition, the most important parts of IDL are concerned with efficient marshaling of data as performed by the COM interception layer, and the majority of the discussion is based on the IDL constructs that affect the behavior of that interception layer. IDL attributes that have no effect on the interception layer will for the most part be ignored.
This book represents a significant amount of research on and testing of the various facilities that IDL provides. In some cases, the information presented may be at variance with the official documentation. The author encourages readers to test the assertions in this book for themselves and confirm that they are correct. All testing performed by the author was done using Microsoft IDL (MIDL) compiler Version 5.03.0280. Earlier versions may not support some of the features detailed in this book.
New versions of the MIDL compiler will emerge, and IDL itself will evolve.
One day, IDL per se may disappear completely, but developers will still need to deal with the things that IDL allows them to describe. Given its popularity and general applicability, eXtensible Markup Language (XML) seems to be an obvious choice as a basis for a description language. To get a head start on the future of IDL (or the IDL of the future), the reader is encouraged to read the W3C Working Draft on XML Schema and the W3C note describing the Simple Object Access Protocol:
w3/TR/xmlschema-0
w3/TR/xmlschema-1
w3/TR/xmlschema-2
w3/TR/soap.html
The author welcomes feedback; any and all questions, observations, and corrections should be sent by e-mail to marting@develop.A Web site for this book is maintained by the author at develop/marting/essen-tialidland includes an errata page and samples.
Intended Audience
This book is aimed at developers and interface designers using COM, Micro-soft Transaction Server (MTS), or COM+ from C++ or Visual Basic. It assumes that the reader has a working knowledge of COM, such as can be found in Essential COM by Don Box or in Programming Distributed Applications with COM+ and Microsoft Visual Basic 6.0by Ted Pattison.
What to Expect
This book is divided into two parts. The first six chapters describe the various constructs available in IDL using fully formed sentences with subjects, verbs, and adjectives. The IDL constructs are shown along with the client-side call sequences and method implementations. Each chapter other than the first con-cludes with a list of guidelines for using the IDL constructs discussed. The last four chapters provide a tabular reference for IDL types, modifiers, keywords, and attributes.
Chapter 1: Hello, IDL
Many COM developers are either unaware of the existence of IDL or unsure as to why it exists. Chapter 1 describes the fundamentals of IDL and the reasons for its existence along with the basics of defining interfaces.
Chapter 2: Structure of an IDL file
The MIDL compiler can output two forms of type information. Which one is generated often depends on the position of a given IDL construct within the IDL file. Chapter 2 covers the details of generating type information and building proxy-stub DLLs, local and remote interfaces, and the various file management constructs.
Chapter 3: Data types and interface issues
Using the proper data types is critical to interface design and component integration. Chapter 3 deals with the details of the primitive IDL types and also covers object references; user-defined types; and enums, structures, and unions. Information about how to ensure that the correct information is present in any generated type library is also presented. This chapter also provides a discussion of interface inheritance.
Chapter 4: Pointers and arrays
Many interfaces need to support output parameters, while others need support for arrays of data. Chapter 4 deals with the details of pointers in IDL, including the different ways that IDL and the COM interception layer treat top-level and embedded pointers. It also covers various array types, including fixed arrays, conformant arrays, and SAFEARRAYs.
Chapter 5: Aliasing
IDL provides support for method and type aliasing, both of which allow inter-face designers to inject arbitrary code into the COM interception layer. Chapter 5 details how to use both types of aliasing, including two approaches to type aliasing: transmit_as and wire_marshal.
Chapter 6: Asynchronous COM
Windows 2000 provides support for asynchronous COM calls from both client and server perspectives. Chapter 6 describes the IDL attribute that makes this possible, along with the details of writing the client-side and server-side code.
Chapter 7: IDL Types
IDL provides certain built-in, primitive types, and the system IDL files provide several constructed types. Chapter 7 is a reference for all the primitive IDL types plus the constructed types BSTR,SAFEARRAY,VARIANT,and VARIANT _BOOL. It provides information such as the size of each type, the type library and Oicf mappings for each type, and the C++ and Visual Basic mappings.
Chapter 8: IDL Type Modifiers
IDL allows types to be qualified with certain type modifiers including, const, signed, and unsigned. Chapter 8 is a reference to all the modifiers supported by IDL and includes information such as whether or not a given modifier is rep-resented in a type library and the data types to which the modifier can be applied.
Chapter 9: IDL Keywords
IDL provides a large number of keywords with various uses from defining inter-faces and structures to importing other IDL files. Chapter 9 is a reference for all the IDL keywords from coclass to union. The information presented includes the forms of type information that represent the keyword, which attributes are mandatory, and which are optional.
Chapter 10: IDL Attributes
The keywords and other constructs in IDL can be annotated with various attributes. Chapter 10 is a reference for all the IDL attributes related to marshaling, plus some others, and includes information about whether a given attribute is present in the type library along with the keywords and constructs to which the attribute is applicable.
0201615959P04062001
Product Details
Would you like to update product info or give feedback on images?
|
![]() |
67% buy the item featured on this page: Essential IDL: Interface Design for COM (The DevelopMentor Series) $39.95 |
![]() |
16% buy Practical IDL Programming $61.51 |
![]() |
13% buy COM IDL and Interface Design |
![]() |
4% buy Essential COM $34.64 |
Tag this product(What's this?)Think of a tag as a keyword or label you consider is strongly related to this product.
Tags will help all customers organize and find favorite items. |
|
Share your thoughts with other customers:
|
|||||||||||
Most Helpful Customer Reviews
Share your thoughts with other customers: Create your own review
|
|
|
This product's forum
Active discussions in related forums
Search Customer Discussions
|
Related forums
|
|
After viewing product detail pages or search results, look here to find an easy way to navigate back to pages you are interested in. |