Export (0) Print
Expand All

How to: Access a COM Component Written in VJ++

Visual Studio 2005

Common Object Model (COM) objects provide a great way to encapsulate functionality and reuse it across multiple applications. You can use COM objects to expose specific functionality within your application. For example, you can create a set of routines that you want to use in more than one application.

Because COM is not language-specific, COM objects can be easily integrated into applications developed in a variety of programming languages. You can use Visual J# to view and import COM objects that are registered on your system. During the import process, Visual J# creates class wrappers so that you can access COM objects just as you would other objects.

The following example shows you how to create a reference to a COM component in your project.

To import a COM component

  1. From Solution Explorer, right-click on References and select Add Reference.

  2. Click the COM tab to display a list of registered COM objects or other libraries and controls.

  3. Select the component you want to import, and click OK.

    The component is displayed in the list of references in Solution Explorer.

  4. To access the COM component in your J# application, add the appropriate import (Visual J#) statement, such as import ClockComponent.

See Also

Community Additions

© 2014 Microsoft