Next Previous Up Top Contents Index

5 Function and Macro Reference

make-pointer

Function

Summary

Creates a pointer to a specified address.
Package

fli

Signature

make-pointer &key address type pointer-type symbol-name functionp => pointer
Arguments

address

The address pointed to by the pointer to be created.

type

The type of the object pointed to by the pointer to be created.

pointer-type

The type of the pointer to be made.

symbol-name

A string containing the name of a symbol defined by a DLL or a foreign callable.

functionp

If type or pointer-type are not specified, then functionp can be used.

Ift, the pointer made is a pointer to type:function. This is the default value.

Ifnil, the pointer made is a pointer to type:void.

module

A string or symbol referring to a module registered withregister-module. If the module specified here does not exist, a module called module is automatically registered.

Values

pointer

A pointer to address.

Description

The functionmake-pointer creates a pointer of a specified type pointing to a given address, or optionally to a function or foreign callable. In the case of a pointer to a foreign callable or foreign function, the module keyword can be used to ensure that the pointer points to the function in the correct DLL if there are other DLLs containing functions with the same name.
Example

In the following example a module is defined, and the variablesetpoint is set equal to a pointer to a function in the module.
(fli:register-module :gdi-dll :real-name "gdi32")

(setq setpoint (fli:make-pointer :symbol-name "SetCursorPos" :module :gdi-dll)

See Also

copy-pointer
with-coerced-pointer

LispWorks Foreign Language Interface - 12 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker