Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • *Experts*
Posted

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.

  • *Experts*
Posted

.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.

Posted

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

<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

.Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...