Registering ActiveX Component using code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Raed Sawalha

    Registering ActiveX Component using code

    Hello I have ActiveX DLL and I usually register it using following procedure

    1. gactutil -i ActiveXDLL
    2. regasm ActiveXDLL /tlb:DLLNAME/codebase
    3. then using the activeX

    can I automate step 1 and 2 inside ActiveX itself
  • Carlos J. Quintero [.NET MVP]

    #2
    Re: Registering ActiveX Component using code

    Hi,

    First of all, gacutil.exe and regasm.exe don´t work with ActiveX DLLs, but
    with .NET assemblies. Some .NET assemblies can be registered as ActiveX
    (COM) components using regasm.exe. Said that, you can use the
    System.Runtime. InteropServices .ComRegisterFun ction and ComUnregisterFu nction
    attributes (see the docs) to perform custom actions when your assembly is
    registered for COM interop using a .NET-aware tool (such as regasm.exe or
    some tool built with System.Runtime. InteropServices .RegistrationSe rvices
    functions). So, in theory you can install the assembly in the GAC while is
    being COM-registered, but I have not tested it.

    --

    Best regards,

    Carlos J. Quintero

    MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
    You can code, design and document much faster.
    Free resources for add-in developers:
    MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.


    "Raed Sawalha" <RaedSawalha@di scussions.micro soft.com> escribió en el
    mensaje news:5BC65873-79AB-4B40-836A-B6C778237496@mi crosoft.com...[color=blue]
    > Hello I have ActiveX DLL and I usually register it using following
    > procedure
    >
    > 1. gactutil -i ActiveXDLL
    > 2. regasm ActiveXDLL /tlb:DLLNAME/codebase
    > 3. then using the activeX
    >
    > can I automate step 1 and 2 inside ActiveX itself[/color]


    Comment

    Working...