Click here to Skip to main content
14,979,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a DLL in VB.Net using COM Class.

I am using it in VB6 code. It works fine in my system. I build a exe of the vb6 and use in other systems.When i try to use in other system i need to register the DLL using command Prompt using the following

regasm "location of the DLL("E:\Dlltet.dll") : Dlltest.tlb /codebase

As this DLL has to be used in many systems, can anyone help me

How can i register the .Net DLL using regasm throgh my VB6 code so that i need not register using command prompt everytime.

I would be thankful if anyone could help me.

Thanks in advance..

Lakshmi
Posted
Comments
Sergey Alexandrovich Kryukov 16-Jun-12 23:54pm
   
Why doing all that, ever?
--SA

You do this by creating an installer for your application, which will automatically handle registering your components on the system.

Whether that's a Windows Install based installation or some batch file that copies everything to where it's supposed to be and does the registration is up to you.
   
You need to create installer for the VB6.0 exe, maybe u can use Installshield wizard which u can download freely. I had the same problem and it was resolved this way only.
   
This is what you need to implement:
1.Check if regasm.exe exist as shown
VB
command = Environ$("WINDIR") & "\Microsoft.NET\Framework\v4.0.30319\" & "regasm.exe"
    If (Not FileExists(command)) Then
        RegisterRegAsm = RegAsmEnum.NoFrameWorkInstalled
        Exit Function
    End If

2. Put a command together as shown
VB
command = command & " /codebase "
    command = command & Chr(34) & App.Path & "\yourfile.dll" & Chr(34) & " /tlb:yourfile.tlb"


3. Execute using shell command and check for return value as shown
res = Shell(command, 0)
if (res=0)then

end if
   
Comments
LakshmiNagaraj 26-Jun-12 2:52am
   
Thank you...
I am aware this post is old....

I have crated an installer using in built Visual Studio which registers my .tlb file.

But for any updates I have to install it again on each and every client machine.

Is the any other solution using which we can implement this?

What I have in mind is writing down a code which checks if tlb is not registered it will copy it from a xyz location and then register it through code. But as I am new to VB6 I am not able to do this.

If you have any solution please can you help me out.
   
Comments
CHill60 17-Dec-13 6:14am
   
If you have a question then use the Ask a Question link - don't post further questions as solutions to old questions as not very many people will view it

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900