<br><font size=2 face="sans-serif">Sorry for what's most likely a neophytes question...</font>
<br>
<br><font size=2 face="sans-serif">I'm trying to call the Win32 API function GetDiskFreeSpaceEx, but when I do the compiler complains and I get the following error: <b>Incompatible type for arg no. 4: Got "pLongint", expected "PLARGEINTEGER"</b></font>
<br>
<br><font size=2 face="sans-serif">The 4th argument is the same type as the 2nd and 3rd arguments, which according to the API Reference they're supposed to be.</font>
<br>
<br><font size=2 face="sans-serif">Here's the code:</font>
<br>
<br><font size=2 face="sans-serif">Program SI;</font>
<br>
<br><font size=2 face="sans-serif">uses</font>
<br><font size=2 face="sans-serif"> WINDOWS;</font>
<br>
<br><font size=2 face="sans-serif">const</font>
<br><font size=2 face="sans-serif"> BUF_SIZE = 255;</font>
<br>
<br><font size=2 face="sans-serif">type</font>
<br><font size=2 face="sans-serif"> pLongint = ^longint;</font>
<br><font size=2 face="sans-serif"> Buffer = array [1..BUF_SIZE] of char;</font>
<br>
<br><font size=2 face="sans-serif">var</font>
<br><font size=2 face="sans-serif"> BytesAvail : pLongint;</font>
<br><font size=2 face="sans-serif"> BytesTotal : pLongint;</font>
<br><font size=2 face="sans-serif"> BytesFree : pLongint;</font>
<br><font size=2 face="sans-serif"> CharBuffer : ^Buffer;</font>
<br>
<br><font size=2 face="sans-serif">BEGIN</font>
<br><font size=2 face="sans-serif"> new (BytesAvail); new (BytesTotal);</font>
<br><font size=2 face="sans-serif"> new (BytesFree); new (CharBuffer);</font>
<br>
<br><font size=2 face="sans-serif"> GetDiskFreeSpaceEx (CharBuffer,BytesAvail,BytesTotal,BytesFree);</font>
<br><font size=2 face="sans-serif">END.</font>
<br>
<br>
<br><font size=2 face="sans-serif">This is from the Win32 Reference:</font>
<br>
<br><font size=2 face="sans-serif">BOOL GetDiskFreeSpaceEx</font>
<br><font size=2 face="sans-serif">(</font>
<br><font size=2 face="sans-serif"> LPCTSTR lpDirectoryName, // pointer to directory name on disk of interest </font>
<br><font size=2 face="sans-serif"> PULARGE_INTEGER lpFreeBytesAvailableToCaller, // pointer to variable to receive free bytes on disk available to the caller</font>
<br><font size=2 face="sans-serif"> PULARGE_INTEGER lpTotalNumberOfBytes, // pointer to variable to receive number of bytes on disk</font>
<br><font size=2 face="sans-serif"> PULARGE_INTEGER lpTotalNumberOfFreeBytes // pointer to variable to receive free bytes on disk</font>
<br><font size=2 face="sans-serif"> );</font>
<br>
<br>
<br><font size=2 face="sans-serif">Now, I'll be the first to admit that I'm no Win32 expert, but to me I did everything correct (but obviously FPC is smarter then I am :-)</font>
<br>
<br><font size=2 face="sans-serif">Can anybody point me in the right direction? TIA...</font>
<br>
<br><font size=2 face="sans-serif">Jim</font>