dlls not referencing

Tewl

Newcomer
Joined
Jan 19, 2003
Messages
4
I am new to vb.net and have been playing around with it, converting some of my old projects to .net My problem is this, in vb 6 i would compile my functions into a activex dll and use it as a reference for future use, but when i compile the functions in vb .net it will not reference it. any ideas what i might be doing wrong?

eg.

Public Class MD5

Public Function MD5(ByVal InputStr As String) As String
Dim AsciiEnc r As New System.Text.ASCIIEncoding()
Dim MD5 As New System.Security.Cryptography.MD5CryptoServiceProvider()

Return Hexit(MD5.ComputeHash(AsciiEnd.GetBytes(InputStr)))
End Function

Private Function Hexit(ByVal ByteArray As Byte()) As String
Dim i As Integer
For i = LBound(ByteArray) To UBound(ByteArray)
Hexit &= Hex(ByteArray(i))
Next
End Function

End Class

when i compile the md5 dll it does not recognize it as a reference.
 
You need to right click on the 'References' item under the project
you wish to use it in, and click 'Add Reference'. Then select either
'.NET Components' and Browse for the DLL, or if your DLL code is in a
seperate project in the same solution, you can click the Projects
tab and select it from there.
 
it works in .net but i want to use these dlls for references in vb6 as well and it does not work
 
.NET components and COM components are two entirely different
things. While it is technically possible to create COM components
in VB.NET, I really wouldn't recommend going to the trouble (that's
just me though). If you really want to make a COM component look
in the MSDN. I'm not even sure that you will be able to make one
that is VB6 compatible, because I'm not really familiar with the
specifics of COM.
 
ActiveX controls are still supported so you could just write a Invisible control and use that, there is something that allows you to use COM in VB
Visual Basic:
<ComClass(ComClass1.ClassId, ComClass1.InterfaceId, ComClass1.EventsId)> _
Public Class ComClass1
       
End Class
I got that out of MSDN a while ago but once the DLLs compiled it should make all the classes with this heading be exported to COM
 
The following page in the documentation may help.

[mshelp]ms-help://MS.VSCC/MS.MSDNVS/vbcn7/html/vawlkWalkthroughCreatingCOMObjectsWithVisualBasicNET.htm[/mshelp]
 
Back
Top