在C#控制台应用程序中调用ocx的方法 [英] Invoking the methods of an ocx in a C# console application

查看:83
本文介绍了在C#控制台应用程序中调用ocx的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

任何人都可以让我知道如何在C#控制台应用程序中调用ocx的方法吗?

提前谢谢.

Pari M

Hi everyone,

Could anyone please let me know how to invoke methods of an ocx in a C# console application?

Thanks in advance.

Pari M

推荐答案

^ ]线程似乎有解决方案,尽管如果您编辑问题以确切说明您要执行的操作,以及为什么,有人可能会建议您更好的方法.
The last answer in this[^] thread seems to have a solution although perhaps if you edit your question to explain exactly what it is you are trying to do, and why, someone might suggest a better method.


通过下面的CP链接

http://www.codeproject.com/KB/COM/cominterop.aspx [ ^ ]
Go through the below CP link

http://www.codeproject.com/KB/COM/cominterop.aspx[^]


添加亨利的答案,如果您通过Visual Studio的添加引用"对话框添加COM引用,interop dll应该会自动生成.然后,您可以正常使用COM类型.
To add to Henry''s answer, the interop dll should get auto-generated if you add a COM reference via the Visual Studio Add Reference dialog. Then you can use the COM types normally.


这篇关于在C#控制台应用程序中调用ocx的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆