Help Contents / Communication / Dynamic Libraries / DynamicLibraryCall

DynamicLibraryCall aDynamicLibrary dlfunctionname paramlist
DLCall aDynamicLibrary dlfunctionname paramlist

command or operation, depending on first of paramlist. The function with name dlfunctionname in the dynamic library aDynamicLibrary is being called, if aDynamicLibrary has been set to a loaded DynamicLibrary. dlfunctionname can also be a list with one element because so you can use case sensitive names without having to setCaseIgnored false. 

The first item of paramlist is the return type of the function. It can be one of the following words: 

	"Int 
	"Int16 
	"Int8 
	"UInt8 
	"Float 
	"Complex 
	"IntArray 
	"Int16Array 
	"FloatArray 
	"Bitmap 
	"Word 
	"Bool 
	"Void 

Then the function's parameters follow in groups of three: 

1.) The name of the parameter, which is only for documentation, 

2.)	The type of the parameter, which can be one of the following words: 

	"Int 
	"IntPtr 
	"Int16 
	"Int16Ptr 
	"Int8 
	"Int8Ptr 
	"UInt8 
	"UInt8Ptr 
	"Float 
	"FloatPtr 
	"Complex 
	"ComplexPtr 
	"Word 
	"IntArray 
	"Int16Array 
	"FloatArray 
	"Bitmap 
	"NodePtr 
	"Bool 

The DLCall primitive supports now argument-by-pointer when "IntPtr, "Int16Ptr, "Int8Ptr, "UInt8Ptr or "FloatPtr are specified as argument type. 

3.) The value of the parameter, which must match the type. 

Examples: 

	to FindWindowA title 
		output DLCall user32 [FindWindowA] (list "Int 
			"Class "Int 0 
			"Title "Word title) 
	end 
	to GetWindowRect hWnd 
		local [status iarr] 
		iarr=IntArray 4 
		status=DLCall user32 [GetWindowRect] (list "Int 
			"hWnd "Int hWnd 
			"rect "IntArray iarr) 
		output iarr 
	end 
	to MoveWindow hWnd x y 
		local [xy status] 
		rect=GetWindowRect hWnd 
		status=DLCall user32 [MoveWindow] (list "Int 
			"hWnd "Int hWnd 
			"X "Int x 
			"Y "Int y 
			"nWidth "Int rect.3-rect.1 
			"nHeight "Int rect.4-rect.2 
			"bRepaint "Int 1) 
	end 
	user32=DynamicLibrary "user32 
	hWnd=FindWindowA [aUCBLogo-4.67] 
	MoveWindow hWnd 200 100 


previous: DynamicLibrary
