Hi All,
How to convert from PULARGE_INTEGER to a character string??
I need to display a value (free disk space) in a message or textbox.
Any ideas would be great,
Thanks,
Donal
Hi All,
How to convert from PULARGE_INTEGER to a character string??
I need to display a value (free disk space) in a message or textbox.
Any ideas would be great,
Thanks,
Donal
_ltoa() converts from a long to char. The fact that it's a pointer shouldn't matter because since you're trying to display free disk space you'll actually be using the value that the pointer points to (in this case the unsigned long).
Hi jdinger,
If i didn't put in the type casting the code won't compile, I'd get this error:
(91) : error C2664: '_ltoa' : cannot convert parameter 1 from 'union _ULARGE_INTEGER *' to 'long'
If I do put in the type casting then I get an Access Violation error when the _ltoa() function runs.
Any Ideas??
Thanks,
Donal
Code:PULARGE_INTEGER lpFreeBytesAvailableToCaller, lpTotalNumberOfBytes,lpTotalNumberOfFreeBytes ; char temp[200]; case IDACHECK: GetDiskFreeSpaceEx("c:",lpFreeBytesAvailableToCaller, lpTotalNumberOfBytes,lpTotalNumberOfFreeBytes); _ltoa((int)lpTotalNumberOfFreeBytes, temp, 10); MessageBox(hwnd, temp, "Free disk Space", MB_OK); return(TRUE); break;
That's because you're trying to convert the pointer itself instead of the value that it points to. Use the * (dereferrence) operator to get the value.