Keyword Reference



Global Const $tagGDIPENCODERPARAMS = "uint Count;" & $tagGDIPENCODERPARAM


Count Number of $tagGDIPENCODERPARAM structures in the array
$tagGDIPENCODERPARAM First $tagGDIPENCODERPARAM structure of the array


Use such kind of code to $i entry being less than the $ibEntries in the $tagGDIPENCODERPARAMS (Count)

; Just to calculate entry size to be OK under x86 or x64
Local $tParam = DllStructCreate($tagGDIPENCODERPARAM)
Local $iParamSize = DllStructGetSize($tParam)

; allocate a $tagGDIPENCODERPARAMS structure with $ibEntries
Local $ibEntries = 3;
Local $tParams = DllStructCreate($tagGDIPENCODERPARAMS & "byte[$iEntrySize * ($ibEntries - 1))
DLLStructSetData($tParams, "Count", $ibEntries)

; Reallocate entry structure to point to the desired $i entry (0-based)
Local $i = 1;
Local $tParamI = DllStructCreate($tagGDIPENCODERPARAM, DllStructGetPtr($tParams, "GUID") + ($i * $iParamSize))

; we can access the $tagGDIPENCODERPARAM selected entry just using $tParam structure which has been reallocated

; if we only use one entry the code is greatly simplified
Local $tParams = DllStructCreate($tagGDIPENCODERPARAMS)
DLLStructSetData($tParams, "Count", 1)

; the entry can be access directly thru $tParams structure