如何在.Net Windows应用程序中使用ocx
我必须在.Net应用程序中使用ocx。在工具箱中,我右键单击并从 com 选项卡添加了 ocx.现在ocx出现在工具箱中并将控件添加到窗体中。当我执行应用程序时,出现此错误“无法加载文件或程序集“Interop.WINCMP3XLib,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null”或其依赖项之一。系统找不到指定的文件。'。你能帮我看看还需要做什么吗?
我还使用 Aximp 工具将包装器 dll 转换为 ocx。现在当我使用这个dll时,我无法访问dll中的方法。
请任何人告诉我在 .Net 应用程序中使用 ocx 的最佳方法。
谢谢
I have to use a ocx in .Net application. In the toolbox, i right clicked and from com tab added the ocx. Now the ocx appeared in the toolbox and added the control to the form. When i execute the application got this error 'Could not load file or assembly 'Interop.WINCMP3XLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.'. Can you help me what else needs to be done.
I also used the Aximp tool to convert the wrapper dll for the ocx. Now when I used this dll, i could not access the method in the dll.
Please can anyone tell me the best way for using ocx in .Net application.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通常你要做的是:
现在两个将出现您的项目的引用 - 当然,相应的 DLL 也必须出现在您的项目的输出文件夹中。然而,这将自动完成。编译项目时。
我从来没有使用过 aximp...
请注意,当您使用 64 位操作系统时,您必须
这对我有用 - 我希望它也对你有用:-)
Usually what you do is:
Now two references will appear for your project - of course the respective DLLs must then also be present in the output folder for your project. This, however, will be done automatically. When compiling the project.
I've never had to use aximp...
Please note that when you use a 64-bit operating system, you have to
This works for me - I hope it will work for you too :-)
您是否尝试过在 Windows 中注册 OCX?
您可以运行以下命令来执行此操作: regsvr32 "c:\myocx.ocx",替换为您的 OCX 文件。这也可以用于 DLL 文件。
Have you tried to register the OCX within windows?
You can do that running: regsvr32 "c:\myocx.ocx", replacing with your OCX file. This can be used too with DLL files.