如何使用运行时命令行参数注册任何DLL或OCX? [英] How to register any DLL or OCX with run time command line arguments?
本文介绍了如何使用运行时命令行参数注册任何DLL或OCX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在运行时注册我的dll和OCX文件.我希望我的DLL和OCX应该通过编码进行注册.
有什么想法可以在运行时传递命令行参数吗?
谢谢
Dhaval Shukla
I want to register my dll and OCX file at run time. I want that with my DLL and OCX should be register through coding.
Is there any idea how can i pass command line arguments at run time?
Thanks
Dhaval Shukla
推荐答案
您可以尝试这样.
You can try like this.
Dim comRegisterProcess As New Process()
comRegisterProcess.StartInfo.FileName = "regsvr32.exe"
comRegisterProcess.StartInfo.UseShellExecute = False
''Register the controls and DLLs.
Const dllPath As String = "c:\com\abc.ocx"
comRegisterProcess.StartInfo.Arguments = String.Format(" /s""{0}""", dllPath)
comRegisterProcess.Start()
comRegisterProcess.Close()
注意:要使用Process
类,您需要添加System.Diagnostics
名称空间.
Note: to use the Process
class you need to improt System.Diagnostics
namespace.
这篇关于如何使用运行时命令行参数注册任何DLL或OCX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文