The types <FARPROC> and <PROC> are defined as equivalent to <C-function-pointer>, so any C function wrapper object can be passed to a routine taking a <FARPROC> without needing to do any type conversion like that needed in C.
Type casts between handles and integers (<integer> or <machine-word>) can be done by using as. For example:
window-class.hbrBackground-value :=
as(<HBRUSH>, $COLOR-WINDOW + 1);
Note that pointers and handles must be compared using =, not ==, in order to compare the C address instead of the Dylan wrapper objects.
For type casts from one pointer type to another, use the function pointer-cast instead of as. Think of as as converting the data structure pointed to, while pointer-cast operates on just the pointer itself.
The Dylan function pointer-value can be used to convert between a Dylan integer and a LARGE-INTEGER or ULARGE-INTEGER. For example:
let li :: make( <PLARGE-INTEGER> ); pointer-value(li) := 0;
allocates a LARGE-INTEGER and sets its value to 0, without needing to be concerned with the individual fields of the internal representation. Alternatively, you can use an initialization keyword:
let li :: make( <PLARGE-INTEGER>, value: 0 );
The C macros MAKEPOINT, MAKEPOINTS, and LONG2POINT do not easily translate to Dylan. Instead, use the Dylan function lparam-to-xy to split a parameter into two signed numbers. For example:
let ( x, y ) = LPARAM-TO-XY(lParam);
In Dylan, <RECTL> is an alias of <RECT> instead of being a distinct type. (In Win32, they are structurally equivalent but were separate types for the sake of source code compatibility with Win16; there is no need to maintain that artificial distinction in Dylan.)
Windows resource files (.rc files) can be included by using the LID file field RC-Files:.