Platform SDK: COM

COM Language Translations

Components created using the Component Object Model (COM) can be reused in applications written in any COM-supporting programming language. This is because COM is a binary standard and, as such, is language-independent.

In this software development kit (SDK), COM objects are documented in the most relevant programming language or languages. For example, objects that are created for use in Web pages are typically documented in the Microsoft® Visual Basic® development system, whereas operating system–level objects are typically documented in C++.

But because COM is language-neutral, you are not constrained to use the object in the same language in which it is written or documented. For example, you can write a Java application that uses a control created in C++ and documented in Visual Basic.

The following topics discuss the differences between programming languages and describe how to translate COM object syntax from one language to another. Additional topics describe how to use COM objects in various scripting languages and environments.

The intent of this document is to address the most common language translation issues that arise when using COM objects. Because scripting languages and programming languages represent different programming paradigms, translation between scripting languages and programming languages is not addressed.

Note  The programming languages discussed in the following topics are Visual Basic, C++, and Java. The scripting languages discussed are Microsoft® Visual Basic Scripting Edition (VBScript), Microsoft® JScript® development software, and JavaScript. The techniques and principles described, however, apply to any programming or scripting language that supports COM.