First, thank for your helps !!!
What I'm doing wrong ?
the code:
class1.vb:
=============== =============== =====
Imports System.Data
Imports System.Xml
<ComClass(RH.Cl assID, RH.InterfaceId, RH.EventsId)> _
Public Class RH
#Region "COM Class IDs"
Public Const ClassID As String = "5F0D4112-B23D-4703-94F5-B5B96E50F3BB"
Public Const InterfaceId As String = "A9DFEE4E-3DBB-4505-BBC6-9BCEE5A220A5"
Public Const EventsId As String = "E6CAB551-4A34-4c4d-83EA-7D3D7E2E49DF"
#End Region
Public val As Integer
Public Sub New()
val = 0
End Sub
Public Function addHistory(ByVa l txtFind As String, ByVal txtReplace As
String) As String
Return "Luis Gustavo Aleixo"
End Function
End Class
=============== =============== =====
AssemblyInfo.vb :
=============== =============== =====
Imports System
Imports System.Reflecti on
Imports System.Runtime. InteropServices
<Assembly: AssemblyTitle(" ")>
<Assembly: AssemblyDescrip tion("")>
<Assembly: AssemblyCompany ("")>
<Assembly: AssemblyProduct ("")>
<Assembly: AssemblyCopyrig ht("")>
<Assembly: AssemblyTradema rk("")>
<Assembly: CLSCompliant(Tr ue)>
'<Assembly: Guid("E8C42458-4ED8-4485-8145-A364D099BC5B")>
<Assembly: Guid("6489269F-2E92-448B-96AF-A9C70B7C8E71")>
<Assembly: AssemblyVersion ("1.0.*")>
=============== =============== =====
I build the solution and is OK !!!
then I open the prompt and execute the command "regasm.exe " so "regasm
replacehistory. dll" and display the message:
"Microsoft (R) .NET Framework Assembly Registration Utility 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Types registered successfully"
I try too: "regasm ReplaceHistory. dll /regfile:rh.reg" and display the
message:
"
Microsoft (R) .NET Framework Assembly Registration Utility 1.1.4322.57
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Registry script 'C:\Documents and Settings\gustav o\My Documents\VBdot N
ace\ReplaceHist ory\ReplaceHist ory\bin\rh.reg' generated successfully
"
and open the reg file.
when I try to execute "regsvr32", the same message is display.
"Tibby" <ti************ *@hotmail.com> wrote in message
news:ee******** ******@TK2MSFTN GP11.phx.gbl...
I need to make one minor correction, in this portion:
<ComClass(Rythm ia.ClassID, Rythmia.Interfa ceId, Rythmia.EventsI d)> ;
Rythmia is the name of my class, so it should read Class1 in this example.
"Tibby" <ti************ *@hotmail.com> wrote in message
news:#3******** ******@TK2MSFTN GP09.phx.gbl... Add this Code
<ComClass(Rythm ia.ClassID, Rythmia.Interfa ceId, Rythmia.EventsI d)> _
Public Class Class1
#Region "COM Class IDs"
Public Const ClassID As String =
"5F0D4112-B23D-4703-94F5-B5B96E50F3BB" Public Const InterfaceId As String =
"A9DFEE4E-3DBB-4505-BBC6-9BCEE5A220A5"
Public Const EventsId As String =
"E6CAB551-4A34-4c4d-83EA-7D3D7E2E49DF" #End Region
Sub Main()
End Sub
End Class
This makes your DLL emulate an ActiveX control. From here, you can
register it, or select the option in the project properties to register it for
COM interop. One thing to remember about the ID's, you need to use the
utility "Luis Gustavo" <lg****@nsb.com .br> wrote in message guidgen, and select
Registry Format. Otherwise, should work just fine.
Good Luck and HTH
Tibby
news:e9******** ******@TK2MSFTN GP09.phx.gbl... Good afternoon.
I would like to know if is possible use a dll made in Vb.net in VB 6.
I made this to test the dll:
Imports System.Data
Imports System.Xml
Public Class RH
Public Shared Function addHistory(ByVa l txtFind As String, ByVal
txtReplace As String) As String
Return "Luis Gustavo Aleixo"
End Function
End Class
the code is rigth, when I try to register with the command "regsvr32"
happen a error:
"---------------------------
RegSvr32
---------------------------
ReplaceHistory. dll was loaded, but the DllRegisterServ er entry point
was not found.
DllRegisterServ er may not be exported, or a corrupt version of
ReplaceHistory. dll may be in memory. Consider using PView to detect
and remove it.
"
What I need to make to use the dll in VB 6?
Luis Gustavo - Brazil
msn: lu*********@cio ns.com.br