Link to home
Start Free TrialLog in
Avatar of Todd_Anderson
Todd_Anderson

asked on

How can I register a COM DLL using VB.NET 2.0?

I need to register a COM DLL using VB.NET 2.0.  How can I do that?  I just want it to do it without any windows or dialog boxes and if it fails for any reason to to continue on without causing an error.

Thanks,

Todd
Avatar of 512Thz
512Thz

Avatar of Todd_Anderson

ASKER

My application is already compete.  Visual Studio created an interop DLL to go along with the COM DLL.  I just need to be able to register the COM DLL and I want to do it using my application.

Todd
Then you can ignore the warning
Forget the last message...

You just need to make a reference to the interop assembly then.

You don't want to use late binding don't you? (If so you need reflection)
I need to register a COM DLL using VB.NET 2.0.  How can I do that?  I just want it to do it without any windows or dialog boxes and if it fails for any reason to to continue on without causing an error.
Here is another way to ask my question.  How can I do this in VB.NET 2.0 code?

    regsvr32 <path & filename of dll>
ASKER CERTIFIED SOLUTION
Avatar of 512Thz
512Thz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For others, here is the VB.NET 2.0 code that I ended up using.

    Shell("regsvr32 /s """ & MyDLL & """)

where "/s" causes the operation to be silent and MyDLL is a string that has the full path and dll name including ".dll".  For example

    MyDLL = "C:\Program Files\MyProgram\MyDLL.DLL"

Thanks for the help,

Todd