Hi,
I need to call a c++ dll and pass to it a pointer to an array of pointers to buffers. The DLL will then fill the buffers with GUID strings. But it seems that my array pointer is not valid.
This is the latest of what I have tried:
Dim $sJobIDs[100], $structJobIdsPtrs[100], $StructJobID, $JobIDsPtr
;
for $i=0 to UBound($sJobIDs) - 1
$sJobIDs[$i]=" " ;enough space for a GUID
$StructJobID = ByteStructFromString($sJobIDs[$i]) ;turn this string into a char array in a C++ structure
$structJobIdsPtrs[$i] = DllStructGetPtr($StructJobID) ;store the pointer to the char array structure
Next
; get a pointer to the first item in the array of pointers
$JobIDsPtr = DllStructGetPtr(DllStructCreate("ptr", $structJobIdsPtrs[0]))
msgbox(0,"","pointer value = " & $JobIDsPtr)
Func ByteStructFromString ( byref $TheString )
Dim $struct = DllStructCreate ( "byte[" & StringLen ( $TheString ) & "]" )
DllStructSetData ( $struct, 1, StringToBinary ( $TheString ) )
Return $struct
EndFunc
But when I display the value of $JobIDsPtr, I get a zero. What am I doing wrong?
Thanks