Using Flash Cards on an H/PC

Flash cards can be a useful method for transferring files and adding extra memory to an H/PC. This section outlines the method for accessing files on flash cards.

A flash card is assigned the folder name Storage Card on the H/PC. To create, copy, or delete files on the storage card, open the Storage Card folder and then create, copy, or delete files on it. A user accesses files on a flash card by double-tapping on the My Handheld PC icon, which brings up the Explorer window, and then selecting the Storage Card folder.

The following code example creates a file named Testfile under \storage card\testdir.

HANDLE   hFile;
DWORD    dwFileLen;
char         szText[]="This is a test file.";

if (CreateDirectory(TEXT("\\Storage Card\\testdir"), NULL))
{
   hFile = CreateFile(TEXT("\\Storage Card\\testdir\\test.txt"),
      GENERIC_WRITE|GENERIC_READ,      //we need read and write access
      FILE_SHARE_READ,                 //allow read access for others
      NULL,                            //security attributes
      CREATE_ALWAYS,                   //always create new file
      0,                                   //file attribute
      NULL);
   WriteFile(hFile, szText, strlen(szText), &dwFileLen, 0);
   CloseHandle(hFile);
}

The actual path for the flash card is \Storage Card, but due to the special character inside the quotes you need to assign the path as \\Storage Card.