在C#中使用ocx文件 [英] Using an ocx file with C#

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

问题描述



我必须在C#Windows应用程序中使用ocx文件.我能够成功引用和访问ocx文件中定义的方法.但是:

Hi,

I have to use an ocx file with my C# Windows application. I am able to successfully refer and and access the methods defined in the ocx file. But:

  1. 当我尝试实例化对象时,例如
  1. When I am trying to instantiate the object like
objIRC = new IRCClass();


然后我编译时间错误是 类型" IRC.IRCClass没有定义构造函数"

  • 所以我尝试了新关键字.发生对象引用错误 对象引用未设置为对象的实例" .在谷歌搜索时,我得到了一些建议,建议使用Activator方法,但发现效果并不理想.

  • then I compile time error is getting "The type ''IRC.IRCClass'' has no constructors defined"

  • So I tried with out new keyword. The object reference error is occuring ''Object reference not set to an instance of an object''. On googling I got some advice to use the Activator methods, which I found not good.

  • 你知道为什么会这样吗?
    注意:我只有ocx文件.不知道.

    谢谢你
    Baji Jabbar:)


    Do you have any idea why this is happening?
    NB: I only have the ocx file. No idea about it.

    Thanking you
    Baji Jabbar :)

    推荐答案

    这仅表示无法实例化此类,但具有私有或受保护的构造函数.看看您在哪里下载了它,也许他们为如何使用它提供了指示.

    祝你好运!
    This simply means that this class cannot be instantiated but is has private or protected constructors. Have a look at where you downloaded it maybe they give pointers on how to use it.

    Good luck!


    这篇关于在C#中使用ocx文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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