Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21090

Passing a Pointer to a Function

$
0
0
Does anyone know how can i declare this function to VB because i get lots of errors when i try to lunch it so im expecting i should refere a variable to a pointer to make it work, but nothing works. Here is the function with the parameters:

Code:

  $simResultsStruct = "float win; float tie; float lose; float winSd; float tieSd; float loseSd; float d94; float d90; int evaluations"
  $simResults = DllStructCreate($simResultsStruct)
  $result = DllCall($dll, "none", "SimulateHand", "str", $hand2, "ptr", DllStructGetPtr($simResults), "float", 0, "float", 1, "uint", 0)

So i ported the following AutoIt function in this format but it doesen't work at all:
Code:

Public Type simstruct
 win as single
 tie as single
 winSd as single
 tieSd as single
 loseSd as single
 d94 as single
 d90 as single
 evaluations as integer
End Type


Public Declare Function SimulateHand lib "psim.dll" (hand as string, simResults as simstruct, param1 as single, param2 as single, param3 as integer)


Private Command1_Click()
 dim a as integer
 
SimulateHand("AsKs3s4s5s", a, 0, 1, 0)

msgbox "You win: " & a & "% percent of the time, error?"
End Sub


Viewing all articles
Browse latest Browse all 21090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>