Solved

VB.Net to VB6 Conversion

Posted on 2013-01-05
7
492 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 74

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 69

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 69

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 69

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now