[fpc-pascal]When to use pointers with win32

Peter Vreman peter at freepascal.org
Tue Nov 26 07:51:47 CET 2002


> At 07:21 25-11-02 +0100, you wrote:
>>The header files are translated from C. Where Delphi defined a definition
>>with const or var parameters then that version is added as an overloaded
>>definition. So you can use both the C calling with passing the address.
>> Or
>>use the Delphi way with passing a value to a var parameter
>>
>
> OK that makes sense, but then again: The following line:
> waveInThread := CreateThread(0, 0, @waveInProc, 0, 0, @threadID);
>
> gives me the compiler error:
> Incompatible type for arg no. 6: Got VOID_POINTER, expected ULONG
>
> whereas the line:
> waveInThread := CreateThread(0, 0, @waveInProc, 0, 0, threadID);
> compiles with no errors.
>
> ??
> (threadID is declared as cardinal)

That is because the CreateThread() with C calling is accidently removed
from the windows unit.






More information about the fpc-pascal mailing list