Getting Object Store Free Space

Determining the available free space in the Object Store or storage device is important before attempting to save large amounts of data, or for providing feedback to the user. Listing 3.1 shows how to obtain this information by calling GetDiskFreeSpaceEx.

Listing 3.1. Displays free space in the object store
 void Listing3_1() { ULARGE_INTEGER ulFree, ulTotalBytes, ulTotalFree; // specify root directory in Object Store if(GetDiskFreeSpaceEx(_T("\\"), &ulFree, &ulTotalBytes, &ulTotalFree)) { cout ≪ _T("Bytes available to caller: ") ≪ tab ≪ ulFree.LowPart ≪ tab ≪ ulFree.HighPart ≪ endl; cout ≪ _T("Total number bytes: ") ≪ tab ≪ ulTotalBytes.LowPart ≪ tab ≪ ulTotalBytes.HighPart ≪ endl; cout ≪ _T("Total num. free bytes: ...

Get Windows® CE 3.0 Application Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.