DllStructPoke

Set the value of a member of a Dll structure represented by a structure handle.

Syntax:

DllStructPoke( structure-handle, member-name, member-value  )

Parameters:

(i) structure-handle: dll Structure handle returned by the DllStructAlloc function.

(s) member-name: structure member name from the structure descriptor string used to create the structure-handle.

(i/i64/s/a) member-value: new value of the structure member.  Must be an array for member with an array data type qualifier.

Returns:

() @TRUE on success.

 

Structure-handle

Dll Structure handle returned by the DllStructAlloc function.

Member-name

Structure member name from the structure descriptor string used to create the 'structure-handle' parameter.

Call the function before passing a DLL structure to a DLL entry point when the entry point is using a structure to obtain information from the caller.

Member-value

New value of the structure member. Must be an array for member with an array data type qualifier.    

The function attempts to convert the member-value parameter to the data type of the member indicated in the structure descriptor string.  However, the value must be an array for array structure members.

Example:
;=========================================================
;   Create the structure
;   struct {
;      int            var1;
;      unsigned char  var2;
;      unsigned int   var3;
;      char           var4[128];
;      float          var5;
;   }
;=========================================================
descriptor = "int:var1 byte:var2 uint:var3 char:var4[128] float:var5"
structhandle = DllStructAlloc( descriptor )
;   Set data in the struct
DllStructPoke( structhandle, "var1", -1  )
DllStructPoke( structhandle, "var2", 255  )
DllStructPoke( structhandle, "var3", -1  )
DllStructPoke( structhandle, "var4", ArrayFromStr( "Hello World" )  )
DllStructPoke( structhandle, "var5", 99.0  )
;   Get data from the struct
Pause("var1", DllStructPeek( structhandle, "var1" ) )
Pause("var2", DllStructPeek( structhandle, "var2" ) )
Pause("var3", DllStructPeek( structhandle, "var3" ) )
Pause("var4", ArrayToStr( DllStructPeek( structhandle, "var4" ) ) )
Pause("var5", DllStructPeek( structhandle, "var5" ) )
; Free all resources associated with a DLL structure handle.
DllStructFree( structhandle )
Exit
See Also:

DataCast, DllCall, DllCallbackDestroy, DllCallCdecl, DllCall Additional information, Binary Operations, DllLoad, DllFree, DllHwnd, DllHinst, DllStructAlloc, DllStructFree, DllStructPeek, IntControl 77IntControl 96, IntControl 97, IntControl 98