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" <fl*******@dsl.pipex.com> wrote in message
news:uo****************@TK2MSFTNGP11.phx.gbl...
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