Solved

VB.Net to VB6 Conversion

Posted on 2013-01-05
7
496 Views
Last Modified: 2013-01-05
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
Comment
Question by:Soumen-Roy
  • 3
  • 3
7 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 38747339
I'm not sure VB6 has a readily available SHA 512 library. You may need to implement your own.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 38747347
I think it would be easier to create a component (.dll) in .Net with this code and use it from VB6.
0
 

Author Comment

by:Soumen-Roy
ID: 38747354
@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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 38747376
0
 

Author Comment

by:Soumen-Roy
ID: 38747386
@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
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 38747392
you will need the .Net framework. the good thing is that it is installed on almost all PC now!
0
 

Author Closing Comment

by:Soumen-Roy
ID: 38747393
Thanx for the idea, I will try it, Thanx a lot
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question