• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

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
0
Todd_Anderson
Asked:
Todd_Anderson
  • 5
  • 4
1 Solution
 
512ThzCommented:
0
 
Todd_AndersonAuthor Commented:
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
0
 
512ThzCommented:
Then you can ignore the warning
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
512ThzCommented:
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)
0
 
Todd_AndersonAuthor Commented:
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.
0
 
Todd_AndersonAuthor Commented:
Here is another way to ask my question.  How can I do this in VB.NET 2.0 code?

    regsvr32 <path & filename of dll>
0
 
512ThzCommented:
You can just use the ShellExecute

http://www.developerfusion.com/article/9/shell-and-shellexecute-function/2/

The Regsvr32.exe program is in C:\WINDOWS\system32
0
 
512ThzCommented:
0
 
Todd_AndersonAuthor Commented:
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
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now