Click to See Complete Forum and Search --> : Creating a Win32 dll (from VB6.0 to C++.Net)


dee-u
March 19th, 2009, 10:32 PM
I am trying to make a Win32 using C++.Net. Below is my code in VB6.0.
Public Function PokerGetPercentage(pocket As String, board As String, opponents As Long, accuracy As Long) As String
Dim sPocket As String
Dim sBoard As String
Dim result As String

Dim Poker As PokerHand
Set Poker = New PokerHand

sPocket = StrConv(pocket, vbUnicode)
sBoard = StrConv(board, vbUnicode)

result = Poker.GetHandStrength(sPocket, sBoard, opponents, accuracy)
PokerGetPercentage = StrConv(result, vbFromUnicode)
End Function

Thus far this is what I came up with.
extern LPSTR PokerGetPercentage(LPSTR pocket, LPSTR board, long opponents , long accuracy )
{
return "ss";
}

My C++ is very basic and I find it difficult to convert my VB6.0 code to C++. Could anyone help? Poker is actually a class from a C# project.

Thanks for any help.

dee-u
March 20th, 2009, 03:42 AM
Upon more digging I've found out that I don't really need a Win32 dll to pass something to AutoIt so this case is rested although not resolved so I will not mark it as one.