Lazarus

Free Pascal => General => Topic started by: dkjMusic on May 17, 2014, 02:18:53 am

Title: How to assign a value to a pointer?
Post by: dkjMusic on May 17, 2014, 02:18:53 am
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?
Title: Re: How to assign a value to a pointer?
Post by: taazz on May 17, 2014, 02:58:01 am
it is a simple cast, pointer(inewvalue).
Title: Re: How to assign a value to a pointer?
Post by: dkjMusic on May 17, 2014, 03:38:00 am
That worked. Many thanks.