Export (0) Print
Expand All

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 C++ code example shows how an unmanaged client might create an instance of the managed Loan class and call one of its methods. COM clients cannot access classes directly, but instead call methods, properties, and events exposed by interfaces implemented by the class.

ILoanPtr pILoan(__uuidof(Loan));
pILoan->GetFirstPmtDistribution(payment, &Balance, &Principal, &Interest,
       &MorePmts);
Show:
© 2014 Microsoft