.NET ActiveX dll and regasm

.NET ActiveX dll and regasm

am 02.10.2007 17:55:24 von 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

Re: .NET ActiveX dll and regasm

am 02.10.2007 21:17:35 von s-mar

>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.

Re: .NET ActiveX dll and regasm

am 03.10.2007 23:55:53 von 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

"Scott M." wrote in message
news:eeHhHjSBIHA.2004@TK2MSFTNGP06.phx.gbl...
> >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.
>
>
>

Re: .NET ActiveX dll and regasm

am 05.10.2007 21:13:52 von s-mar

"Lou" wrote in message
news:Oei6sggBIHA.912@TK2MSFTNGP05.phx.gbl...
>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.

> 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


>
> "Scott M." wrote in message
> news:eeHhHjSBIHA.2004@TK2MSFTNGP06.phx.gbl...
>> >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.
>>
>>
>>
>
>