Forum > General

How to assign a value to a pointer?


I retrieved the following in a Google-search re setting mouse speed:
I had the same problem. What M$ thought when they cooked this up is a complete mystery to me. Anyway, the solution:

DWORD iNewSpeed; /* between 0 and 20 */

SystemParametersInfo(SPI_SETMOUSESPEED,0,(void*)iNewSpeed, NULL);

Note the cast to a pointer.. you do not pass a pointer to the variable
(which seems more logical) but you pass the value directly, disguised as a pointer.
My question is how do I implement (void*)iNewSpeed in Free Pascal?

it is a simple cast, pointer(inewvalue).

That worked. Many thanks.


[0] Message Index

Go to full version