Calling a .NET Object

A COM client can create an instance of a public class in an assembly and call the public members of the class. The common language runtime marshals the calls to and from the managed object.

The following code example creates an instance of the Loan class. COM clients cannot access classes directly, but instead call methods, properties, and events exposed by interfaces implemented by the class.

ILoanPtr pILoan(__uuidof(Loan));

The ILoan interface exposes several methods and properties, including the GetFirstPmtDistribution method.

pILoan->GetFirstPmtDistribution(payment, &Balance, &Principal, &Interest,
       &MorePmts);

See Also

Exposing .NET Framework Components to COM | Registering Assemblies with COM | Referencing .NET Types from COM | Deploying an Application for COM Access