使用代码注册ocx [英] Registering ocx using code

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

问题描述


我正在使用以下代码注册ocx,但是t不起作用.

Process.Start("regsvr32","D:\ Urdu \ urdutextbox15.ocx")

错误是系统找不到指定的文件

我确保文件在那里并且名称也完全相同(我已确认粘贴)

请帮忙.


I am using following code to register an ocx but t does not work.

Process.Start("regsvr32 ", "D:\Urdu\urdutextbox15.ocx")

Error is The system cannot find the file specified

I have made sure file is there and name is also exactly the same (I coped pasted to make sure)

Please help.

推荐答案

OCX是DLL,它公开了DllRegisterServer和DllUnregisterServer函数.您可以将它们与LoadLibrary和GetProcAddress一起使用,以注册OCX-假定其接口永远不变.
如果OCX可以更改,并且二进制兼容性可能会破坏,则应使用标准安装程序(msi,install shield等):如果它是第三方OCX,请参阅作者提供的文档,如果您(或您的公司)编写了OCX,并将其添加到产品的安装程序中.
通常,自注册(regsvr32也调用DllRegisterServer,因此应该将其视为自注册)现在被视为一件坏事,尽管它曾经是标准的,而MSI(Windows Installer)则是一件好事. > 希望对您有所帮助,
An OCX is a DLL, it exposes the functions DllRegisterServer and DllUnregisterServer. You may use them, with LoadLibrary and GetProcAddress, to register the OCX - assuming its interface will never change.
If the OCX can change, and binary compatibility may be broken, you should use a standard installer (msi, install shield, ...) for it: if it is a third-party OCX, see the documentation provided by the author, if you (or your company) wrote the OCX, add it to the installer for your product.
In general, self-registration (regsvr32 calls DllRegisterServer too, so it should be considered self-registration) is now considered a bad thing, though it used to be the standard, and MSI (Windows Installer), a good thing.
Hope this helps,


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

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