//TH-Header //***************************************************************************************** // Copyright (c) 2000 Michael Kurz // All rights reserved. // If you want to use this source in your applications conatct: // // $FileName : mPoiner.Pkg // $ProjectName : Shared Methods and Commands. // $Author : Michael Kurz // $Created : 02-01-2001 @ 19:00 // // Contents: // Some useful commands and function when you use WinAPI Stuff or other // DLL's which will ver often need pointers. // // $Rev History // //***************************************************************************************** // Implements a C++ Makro. Function MAKEWPARAM Global Integer iLow Integer iHi Returns Integer Function_Return (iLow+(65536*iHI)) End_Function // Defines a Variable only if not defined. #COMMAND Local_Ex !1 !2 #IFDEF !2 #ELSE Local !1 !2 #ENDIF #ENDCOMMAND // Checks if a string var isnt defined and defines it! // The same is done for the 2nd Para as a Pointer var. #COMMAND DEFINE_STR_PTR R R #IFDEF !1 // String Buffer fuer Position #ELSE Local String !1 #ENDIF // Pointer darauf #IFDEF !2 #ELSE Local String !2 #ENDIF #ENDCOMMAND // Two usages: // 1.You have a string variable and want to create a pointer which contains its Addres. // 2.You'd like to String Buffer Init it to a length and Create and fille the Address Pointer #COMMAND Local_BUFFER R R DEFINE_STR_PTR !1 !2 // Test if the string - Var and the Pointer Var are define, if not defines it. #IF !0>2 Move (Repeat(Character(0),!3)) To !1 #ENDIF #IF !0>3 Move !4 To !1 #ENDIF Append !1 (Character(0)) GetAddress Of !1 To !2 #ENDCOMMAND // To avoid compilation errors when already declared. (VDF7+!) #COMMAND External_FunctionEx #IFNDEF GET_!1 External_Function !1 !2 !3 !4 !5 !6 !7 !8 !9 #ENDIF #ENDCOMMAND // Is a command that allows to put a string as pointer into a structure // Usage: PUT_POINTER sName pName "String..." to sBuff at TYPE.FIELD #COMMAND PUT_POINTER R R R "TO" R "AT" R Local_Buffer !1 !2 Move !3 To !1 GetAddress Of !1 To !2 Put !2 To !5 at !7 !8 #ENDCOMMAND