Tewl Posted January 19, 2003 Posted January 19, 2003 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. Quote
*Experts* Volte Posted January 19, 2003 *Experts* Posted January 19, 2003 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. Quote
Tewl Posted January 19, 2003 Author Posted January 19, 2003 it works in .net but i want to use these dlls for references in vb6 as well and it does not work Quote
*Experts* Volte Posted January 19, 2003 *Experts* Posted January 19, 2003 .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. Quote
AndreRyan Posted January 20, 2003 Posted January 20, 2003 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 Quote .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?
*Gurus* divil Posted January 20, 2003 *Gurus* Posted January 20, 2003 The following page in the documentation may help. [mshelp]ms-help://MS.VSCC/MS.MSDNVS/vbcn7/html/vawlkWalkthroughCreatingCOMObjectsWithVisualBasicNET.htm[/mshelp] Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.