Home All Groups Group Topic Archive Search About

Register DLL for COM interop

Author
24 Apr 2006 8:19 AM
Philip Wagenaar
I am trying to create a vb6 activeX dll in .Net. I used the upgrade wizard in
vs.net to load my vb6 project and it converted it to vb.net. Now I know that
I have to register the DLL from COM interop. I can check the box in vs.net on
the compiler tab to do this.

But how do I register my DLL for COM interop on another machine?

Author
24 Apr 2006 9:20 AM
Peter Huang" [MSFT]
Hi Philip,

I think you may try to use the Regasm tool, which will do the job just as
the IDE do.
Assembly Registration Tool (Regasm.exe)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
l/cpgrfAssemblyRegistrationToolRegasmexe.asp

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Author
24 Apr 2006 10:13 AM
Carlos J. Quintero [VB MVP]
Hi Philip,

>I am trying to create a vb6 activeX dll in .Net.

Technically speaking, you can´t create VB6 ActiveX dlls in .NET. You can
create DLLs using VB.NET / C# that can behave as ActiveX components using
COM Interop.

> I used the upgrade wizard in
> vs.net to load my vb6 project and it converted it to vb.net. Now I know
> that
> I have to register the DLL from COM interop. I can check the box in vs.net
> on
> the compiler tab to do this.
> But how do I register my DLL for COM interop on another machine?

You have several options:

- Manually you can use the command-line regasm.exe utility, likely with the
/codebase switch. Check the docs about this.

- Programatically you can use the
System.RunTime.InteropServices.RegistrationServices class, using the
RegisterAssembly function, for example.

- If your setup technology is aware of registration of .NET assemblies for
COM Interop, you should instruct the setup to do this.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
Author
24 Apr 2006 11:03 AM
Philip Wagenaar
Can I instruct the Setup project template in vs.net 2005 to register it?

Show quoteHide quote
"Carlos J. Quintero [VB MVP]" wrote:

> Hi Philip,
>
> >I am trying to create a vb6 activeX dll in .Net.
>
> Technically speaking, you can´t create VB6 ActiveX dlls in .NET. You can
> create DLLs using VB.NET / C# that can behave as ActiveX components using
> COM Interop.
>
> > I used the upgrade wizard in
> > vs.net to load my vb6 project and it converted it to vb.net. Now I know
> > that
> > I have to register the DLL from COM interop. I can check the box in vs.net
> > on
> > the compiler tab to do this.
> > But how do I register my DLL for COM interop on another machine?
>
> You have several options:
>
> - Manually you can use the command-line regasm.exe utility, likely with the
> /codebase switch. Check the docs about this.
>
> - Programatically you can use the
> System.RunTime.InteropServices.RegistrationServices class, using the
> RegisterAssembly function, for example.
>
> - If your setup technology is aware of registration of .NET assemblies for
> COM Interop, you should instruct the setup to do this.
>
> --
>
> Best regards,
>
> Carlos J. Quintero
>
> MZ-Tools: Productivity add-ins for Visual Studio
> You can code, design and document much faster:
> http://www.mztools.com
>
>
>
>
>
>
Author
24 Apr 2006 11:43 AM
Peter Macej
> Can I instruct the Setup project template in vs.net 2005 to register it?

Yes. In your setup project, just set "Register" property for your DLL
file to something containing COM. See
http://msdn2.microsoft.com/en-US/library/z5s1e2wh.aspx for more details.


--
Peter Macej
Helixoft - http://www.vbdocman.com
VBdocman - Automatic generator of technical documentation for VB, VB
..NET and ASP .NET code