Interfacing Ada 95 to Microsoft COM and DCOM Technologies David Botton Interactive Intelligence, Inc. Ada Core Technologies, Inc. 600 West Hillsboro Blvd., Suit 325 73 Fifth Avenue, 11B Deerfield Beach, Florida 33441 New York, New York 10003 (954) 698-0030x187
[email protected] 1. ABSTRACT technologies released by Microsoft has been based on COM and DCOM. COM, the Component Object Model, and DCOM, Distributed COM, were introduced as Using COM objects requires access by the language or tool to the Win32 API and the ability to interface to C. the underlying technologies of Microsoft’s Additionally, the ability to create interfaces conforming to second version of OLE, but have since proven the COM binary standard is needed. Ada provides the their utility as powerful model for distributed ability to interface to C and many Ada compilers that systems. This paper intends to introduce COM generate code for Windows NT provide the capability of and DCOM to the Ada community and creating binaries that comply with the COM standard. demonstrate how to create and use objects This paper demonstrates the fundamentals of interfacing that conform to these models. Ada to Microsoft’s COM and Distributed COM technologies. Three applications are constructed, a COM 1.1 Keywords client, a single apartment in-process COM object with a Component Object Model, COM, Distributed COM, single interface, and an application to register a COM Components, ActiveX, OLE object on a remote machine for Distributed use. Creating 2. INTRODUCTION more robust COM objects that build on these applications will require, as a base, knowledge of Microsoft’s Interface Microsoft introduced Object Linking and Embedding 2 Definition Language (IDL) and how to use the extended (OLE 2), a collection of objects providing various services COM types VARIANT and BSTR from the Win32 API.