.NET ActiveX dll and regasm

L

Lou

I know I can make an ActiveX dll in .NET and it uses interop.
So I end up with 2 files, the .dll and the interop file.
I also know I need to use Regasm or something like that to register the .dll
as a COM object.
Am I right so far?

lets say I create a VB6 app and want to use the .NET dll.
Does the installer of the VB6 app have to register the .NET dll by calling
Regasm or can the
VB6 app call it directly the first time it runs.

I am somewhat confused on how all this works together.
any light in this would be appreciated.

-lou
 
S

Scott M.

I know I can make an ActiveX dll in .NET and it uses interop.

Uh, no you can't. You can *use* and ActiveX control in a .NET program via
InterOp, but not *create* an ActiveX control using .NET.
So I end up with 2 files, the .dll and the interop file.
I also know I need to use Regasm or something like that to register the
.dll as a COM object.
Am I right so far?

lets say I create a VB6 app and want to use the .NET dll.
Does the installer of the VB6 app have to register the .NET dll by calling
Regasm or can the
VB6 app call it directly the first time it runs.

If you create a .NET .dll and want to use it within a COM application,
you'll need to register the .NET assembly for use with COM InterOp (in the
..NET project's assembly settings). This will generate a COM .dll you can
then register via normal means and use from your COM app.
 
L

Lou

I figured out if I use Regasm and use the /reg switch which creates a .reg
file.
if I run the .reg file on the target machine, the .NET COM component works
fine.
I cannot register it as a normal COM component using regsvr32, it fails.
I think your info was wrong? It can't be registered in normal ways.
-Lou
 
S

Scott M.

Lou said:
I figured out if I use Regasm and use the /reg switch which creates a .reg
file.
if I run the .reg file on the target machine, the .NET COM component works
fine.

There is no such thing as a .NET COM component. What happens is that you
have a .NET assembly, but by marking it for use with COM a wrapper is made
for your .NET assembly (a COM Callable Wrapper - CCW). It is this CCW that
your COM application interoperates with, not your .NET assembly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top