To consume a managed type from COM 之三 Calling a .NET Object
2009-12-28 12:34
387 查看
Calling a .NET Object
.NET Framework Developer's Guide
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
[C++]
ILoanPtr pILoan(__uuidof(Loan));
The
[C++]
pILoan->GetFirstPmtDistribution(payment, &Balance, &Principal, &Interest,
&MorePmts);
.NET Framework Developer's Guide
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
Loanclass. COM clients cannot access classes directly, but instead call methods, properties, and events exposed by interfaces implemented by the class.(注:COM 客户端不能直接访问类,而是通过接口调用方法、属性、事件等。)
[C++]
ILoanPtr pILoan(__uuidof(Loan));
The
ILoaninterface exposes several methods and properties, including the GetFirstPmtDistribution method.
[C++]
pILoan->GetFirstPmtDistribution(payment, &Balance, &Principal, &Interest,
&MorePmts);
相关文章推荐
- To consume a managed type from COM 之四 Deploying an Application for COM Access
- To consume a managed type from COM 之一 Register assemblies with COM
- Calling Managed .NET C# COM Objects from Unmanaged C++ Code
- The method queryForMap(String, Object...) from the type JdbcTemplate refers to the missing type DataAccessException
- Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.E
- java中的类型安全问题-Type safety: Unchecked cast from Object to ... 或者 Type safety: Unchecked cast from Type to Class<T>
- Type mismatch: cannot convert from java.sql.Connection to com.sun.。。。问题的解决
- Type mismatch: cannot convert from java.sql.PreparedStatement to com.mysql.jdbc.PreparedStatement
- Failed to load implementation from: com.github.fommil.netlib.NativeSystemBLAS解决方法
- Jdbc-Type mismatch: cannot convert from java.sql.ResultSet to com.mysql.jdbc.ResultSet
- web项目整合MongoDb出现No converter found capable of converting from org.bson.types.ObjectId to type Long异常
- Unable to cast COM object of type 'System.__ComObject' to class type 的解决办法
- consume an asp.net webservice(upload a file to server) from java via soap
- Unable to cast COM object of type Microsoft.Office.Interop.Excel.ApplicationClass' ...
- 2006-7有价值的Kean博客——Calling ObjectARX functions from a .NET Application(PInvoke)
- Type safety: Unchecked cast from Object to ArrayList
- net.sf.json.JSONOBJECT.fromObject 与 com.alibaba.fastjson.JSONObject.parseObject
- The method update(String, Object...) from the type JdbcTemplate refers to the missing type DataAcces
- JsonException: Max allowed object depth reached while trying to export from type System.Single
- Access restriction: The method typeNameToClass(String) from the type ObjectHandler is not accessible due to restriction on required library