473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

ActiveX DLL registration in VB.NET

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
Nov 20 '05 #1
3 4223
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

Nov 20 '05 #2
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}" <An******@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com...
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

Nov 20 '05 #3
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

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: don | last post by:
hello all, msdn says this about using a dotnet windows control library in activex environment... You have to write one relatively small piece of code to make your .NET control accessible to...
13
by: Randy Dietz | last post by:
Hi, how can I create a simple non-UI dll or component which will be used by MS Access and .ASP apps which I can build with Visual C++ .net? An example or template which would allow me to paste in...
0
by: Ted | last post by:
I'm using a 3rd party ActiveX control which has it's own constructor and two very methods (which ultimately sends out messages on the server's USB or serial port). I am trying to run this ActiveX...
8
by: Alex | last post by:
Hello, I am trying to access some windows components from a web based application and I am having trouble find my way. The only solution seems to be to creat an ActiveX control to access the...
3
by: Raed Sawalha | last post by:
I created an ActiveX control using Visual Studio .NET 2003 and will use it with HTML page , the problem I have that I need not to foce the client to Register the ActiveX in order to use, i need the...
0
by: Sunil Menon | last post by:
Dear All, Can we automatically register ActiveX controls on aspx pages? I know that winform controls don't need registration, but they require CLR & .Net runtime installed on the client...
7
by: Jarod_24 | last post by:
I just downloaded a activex control that was written in C# and tried to view it on my PDA's Internet Explorer. At my regular PC it displayed just fine, but nothing showed up on the pda. Do...
7
by: Khaled Hussein | last post by:
Hi Every body, I am currently working in aproject where I am stuck in merging an ActiveX control (*.ocx) file into a managed Class Library (*.dll). I want to hide the ActiveX Control in this...
5
by: Michael Maes | last post by:
Hi, We have an ERP-Application that needs to interact with an "external accountancy program". This is acchieved through a "Connector" (ActiveX-dll) so kindly provided by the Accountancy-Program....
4
by: Mr Seth T | last post by:
Hey, I have spent several days trying to find out how to do something, and i don't know if I am blind or what, but I can not find it. I am developing a web app and I need it to run an activex...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.