PC Review


Reply
Thread Tools Rate Thread

ActiveX DLL registration in VB.NET

 
 
Paul Bromley
Guest
Posts: n/a
 
      13th May 2004
I am using an ActiveX control in a VB.NET application as there is no
alternate .Net control available to me. The problem is that when I try to
install this appliaction on another machine the DLL is not registered. The
only way aound this that I have found is to build a ismple VB6 application
purely to register the DLL what am I doing wrong? An Interop is being
created. I have been unable to find any information on this one and it ha
been annoying me for months. The VB6 method works fine, I just want a neater
way by VB.NET of achieving this.

Best wishes


Paul Bromley


 
Reply With Quote
 
 
 
 
=?Utf-8?B?QW5hbmRbTVZQfQ==?=
Guest
Posts: n/a
 
      13th May 2004
Regsvr32.exe

Rgds,
Anand M
VB.NET MVP
http://www.dotnetindia.com

"Paul Bromley" wrote:

> I am using an ActiveX control in a VB.NET application as there is no
> alternate .Net control available to me. The problem is that when I try to
> install this appliaction on another machine the DLL is not registered. The
> only way aound this that I have found is to build a ismple VB6 application
> purely to register the DLL what am I doing wrong? An Interop is being
> created. I have been unable to find any information on this one and it ha
> been annoying me for months. The VB6 method works fine, I just want a neater
> way by VB.NET of achieving this.
>
> Best wishes
>
>
> Paul Bromley
>
>
>

 
Reply With Quote
 
Paul Bromley
Guest
Posts: n/a
 
      13th May 2004
Those using my application are far from computer literate - tell them to
bring up Run from the Start menu, and they would be lost. I was wondering of
I was missing a way to get a dll automatically registeredduring the
installation process. Otherwise I will have to continue with my VB6
installer first.

Best wishes

Paul Bromley



"Anand[MVP}" <(E-Mail Removed)> wrote in message
news9137C91-A71F-49B6-9E57-(E-Mail Removed)...
> Regsvr32.exe
>
> Rgds,
> Anand M
> VB.NET MVP
> http://www.dotnetindia.com
>
> "Paul Bromley" wrote:
>
> > I am using an ActiveX control in a VB.NET application as there is no
> > alternate .Net control available to me. The problem is that when I try

to
> > install this appliaction on another machine the DLL is not registered.

The
> > only way aound this that I have found is to build a ismple VB6

application
> > purely to register the DLL what am I doing wrong? An Interop is being
> > created. I have been unable to find any information on this one and it

ha
> > been annoying me for months. The VB6 method works fine, I just want a

neater
> > way by VB.NET of achieving this.
> >
> > Best wishes
> >
> >
> > Paul Bromley
> >
> >
> >



 
Reply With Quote
 
Gagik A.
Guest
Posts: n/a
 
      13th May 2004
Paul,
What do you use for installation tool? Most of the installers provide an
option to register a DLL/OCX automatically.

As an alternative solution, you can register the control programmaticaly
when your application starts up. Below is a VB .NET code snippet from .NET
framework SDK documentation that you can use as a starting point for
registering the control and creating the interop programmatically.

Hope this helps
Gagik A
--------------------------------------------------------------------------
Automate your VB, VC++ and .NET component builds
http://www.visualmake.com
--------------------------------------------------------------------------

Imports System
Imports System.Reflection
Imports System.Reflection.Emit
Imports System.Runtime.InteropServices

Public Class App
Private Enum RegKind
RegKind_Default = 0
RegKind_Register = 1
RegKind_None = 2
End Enum 'RegKind

<DllImport("oleaut32.dll", CharSet:=CharSet.Unicode,
PreserveSig:=False)> _
Private Shared Sub LoadTypeLibEx(ByVal strTypeLibName As [String], ByVal
regKind As RegKind, <MarshalAs(UnmanagedType.Interface)> ByRef typeLib As
[Object])
End Sub

Public Shared Sub Main()
Dim typeLib As [Object]
LoadTypeLibEx("SHDocVw.dll", RegKind.RegKind_None, typeLib)

If typeLib Is Nothing Then
Console.WriteLine("LoadTypeLibEx failed.")
Return
End If

Dim converter As New TypeLibConverter()
Dim eventHandler As New ConversionEventHandler()
Dim asm As AssemblyBuilder =
converter.ConvertTypeLibToAssembly(typeLib, "ExplorerLib.dll", 0,
eventHandler, Nothing, Nothing, Nothing, Nothing)
asm.Save("ExplorerLib.dll")
End Sub 'Main
End Class 'App
_

Public Class ConversionEventHandler
Implements ITypeLibImporterNotifySink

Public Sub ReportEvent(ByVal eventKind As ImporterEventKind, ByVal
eventCode As Integer, ByVal eventMsg As String) Implements
ITypeLibImporterNotifySink.ReportEvent
' handle warning event here...
End Sub 'ReportEvent

Public Function ResolveRef(ByVal typeLib As Object) As [Assembly]
Implements ITypeLibImporterNotifySink.ResolveRef
' resolve reference here and return a correct assembly...
Return Nothing
End Function 'ResolveRef
End Class 'ConversionEventHandler
---------------------------------------
"Paul Bromley" <(E-Mail Removed)> wrote in message
news:uolRH%(E-Mail Removed)...
> I am using an ActiveX control in a VB.NET application as there is no
> alternate .Net control available to me. The problem is that when I try to
> install this appliaction on another machine the DLL is not registered. The
> only way aound this that I have found is to build a ismple VB6 application
> purely to register the DLL what am I doing wrong? An Interop is being
> created. I have been unable to find any information on this one and it ha
> been annoying me for months. The VB6 method works fine, I just want a

neater
> way by VB.NET of achieving this.
>
> Best wishes
>
>
> Paul Bromley
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: HOW TO ActiveX registration Douglas J. Steele Microsoft Access Forms 0 26th Oct 2006 01:20 PM
activex listview sp6 registration Anthony Microsoft Access Security 1 14th Jul 2005 08:09 AM
ActiveX Registration =?Utf-8?B?UmFlZCBTYXdhbGhh?= Microsoft VC .NET 3 15th Jun 2005 11:01 AM
Registration of ActiveX Components via VBA Milan Microsoft Access Forms 4 21st Aug 2004 06:58 PM
ActiveX registration in Win2003 Robert A. Williams Microsoft Windows 2000 Developer 0 10th Nov 2003 03:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:13 PM.