简体   繁体   中英

How do you call a com object method from c# 4.0

The API documents describe the method as such:

boolean MethodName(VARIANT* par)

The parameter is a ref type which returns an error code.

How do I call this method using c# 4.0's new features?

Just use the old way, there's nothing in 4.0 that makes this method any easier to use. Add a reference to the COM type library, usually the DLL itself, and you should get a class with the method bool MethodName(ref object). What you are supposed to do with the object is completely unclear from your question. Check the API manual, get help from the component vendor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM