FFI Callbacks

Andreas Raab andreas.raab at gmx.de
Fri Sep 1 16:35:37 UTC 2006


Diego Fernandez wrote:
> An off topic question:
> I never used FFI, It's possible to make function calls like in the
> example shown above, or I must to use the special syntax: <...> ?

Why anyone would want to do this is beyond me, but here you go:

aFunction := ExternalLibraryFunction
	name:'EnumWindows'
	module: 'user32'
	callType: ExternalFunction callTypeAPI
	returnType: ExternalType bool
	argumentTypes: {
		ExternalType char asPointerType.
		ExternalType uint32
	}.
aFunction invokeWith: address with: 0.

Cheers,
   - Andreas



More information about the Squeak-dev mailing list