• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 533
  • Last Modified:

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
0
Soumen-Roy
Asked:
Soumen-Roy
  • 3
  • 3
1 Solution
 
käµfm³d 👽Commented:
I'm not sure VB6 has a readily available SHA 512 library. You may need to implement your own.
0
 
Éric MoreauSenior .Net ConsultantCommented:
I think it would be easier to create a component (.dll) in .Net with this code and use it from VB6.
0
 
Soumen-RoyAuthor Commented:
@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
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
Éric MoreauSenior .Net ConsultantCommented:
0
 
Soumen-RoyAuthor Commented:
@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
0
 
Éric MoreauSenior .Net ConsultantCommented:
you will need the .Net framework. the good thing is that it is installed on almost all PC now!
0
 
Soumen-RoyAuthor Commented:
Thanx for the idea, I will try it, Thanx a lot
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now