Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Activating a COM Object 

The technique you use to reference the assembly depends on your programming environment and your preferences. The syntax for activating a COM object is language-dependent. For syntax and usage references, see your language documentation.

Assuming that you have an assembly containing the Loan class and its members, you can perform early-bound activation with little effort. The following code example activates an instance of the LOANLib.Loan coclass from managed code:

using System;
using LoanLib;

public class LoanApp {
    public static void Main(String[] Args) {
        Loan ln = new Loan();

When a .NET client creates an instance of the Loan coclass, the runtime must locate its metadata, regardless of whether the class is a .NET class or a COM coclass. Metadata must be available at run time in order to early bind to a class. Metadada is not required for late-bound activation.

See Also

Community Additions

© 2015 Microsoft