Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Blank_Struct function ====== ==== Description ==== Builds a blank structure to pass to a DLL which will then fill in the structure's elements. ==== Syntax ==== //struct// = **Blank_Struct**(//structname//) ==== Parameters ==== Many DLL functions, including some in the Windows API, take a pointer to a structure as an argument and use that pointer to set values in the structure. To call one of these functions, prototype the parameter as being LPCHAR (meaning a pointer to the first byte of something) and use Blank_Struct to generate a blank structure for the function to fill. The structure definition must be pre-defined using the [[define_struct|Define_Struct routine]]. The RECT struct for the example below is defined as follows: {{{guides:programming:programmers_reference_manual:rectstruct.gif?372x353}} ==== See Also ==== [[build_struct|Build_Struct()]], [[define_struct|Define_Struct]], [[struct_len|Struct_Len()]], [[var_to_struct|Var_To_Struct()]], [[parse_struct|Parse_Struct]], [[chapter_dll|Chapter 7: Calling DLL Functions from Basic+]] ==== Example ==== <code> * assumes the structure called RECT has been defined as * above and the API function GetWindowRect has been defined in * DLL_USER32 (the 32 bit DLL) as: * VOID STDCALL GetWindowRect(HANDLE, LPCHAR) declare function Get_Property, Blank_Struct declare subroutine Parse_Struct, GetWindowRect hwnd = Get_Property(@window , 'HANDLE') rect = Blank_Struct('RECT') GetWindowRect(hwnd, rect) Parse_Struct (rect, 'RECT', left, top, right, bottom) </code> guides/programming/programmers_reference_manual/blank_struct.txt Last modified: 2024/10/14 18:18by 127.0.0.1