Link to home
Start Free TrialLog in
Avatar of Soumen-Roy
Soumen-RoyFlag for India

asked on

VB.Net to VB6 Conversion

Hi Experts,

Can anybody convert the following code to VB6?

Private Function SHA512String(ByVal input As String) As String
        Dim data() As Byte = System.Text.Encoding.ASCII.GetBytes(input)
        Dim shaM As New SHA512Managed()
        Dim result() As Byte = shaM.ComputeHash(data)
        Dim output As String = ""
        For Each b As Byte In result
            output += b.ToString("x2")
        Next
        Return output
    End Function
Avatar of kaufmed
kaufmed
Flag of United States of America image

I'm not sure VB6 has a readily available SHA 512 library. You may need to implement your own.
I think it would be easier to create a component (.dll) in .Net with this code and use it from VB6.
Avatar of Soumen-Roy

ASKER

@emoreau

Is it not possible to do that in VB6?

I can make VB.Net dll from that code, say named a.dll. But I don't know how the dll can be called from VB6. Can you please help?

Regards,
Soumen
@emoreau,

Thank you for the link, just one more little query, if I make the above function in VB.Net and compile it as dll, then call that dll from VB6 exe, will that VB6 exe need framework as it is calling .net dll or; framework will not needed as it is compiled as COM?

Please help,
Regards,
Soumen
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanx for the idea, I will try it, Thanx a lot