I have a Workabout PRO 7525S G1. I am short on Storage Memory. When I go to Settings / Memory and look at the Storage Memory usage it tells me
I have 27.16MB in total with only 0.1 MB free. I have a relatively high amount of Program Memory left - 91.61MB. This leaves the machine running slowly and issuing warnings about critically low memory. I noticed that there was an SD card slot under the battery. I inserted a 512MB SD card I had lying around. However the Storage Memory stats remained unchanged. However the Storage Card tab on the memory Settings has detected the SD-MMC Card and shows the 512MB card. It also shows the 8.0MB RAM disk.
I would like my application (which lives under \Program Files\MyApp) to have access to the SD-MMC memory. Can anyone explain how this can be done ? Ideally I'd like to map the MyApp directory to the SD-MMC card so that I need not worry about memory space any longer. The main culprit in my App is a !0MB database file which is only going to grow in size as time goes on.
Any suggestions would be appreciated.
Regards,
Nick Fitzsimons,
Developer,
Site Direct Ltd
Good afternoon Nick,
SD cards can be accessed like any other drives.
This said, let me bring the below book excerpt [1] to your attention
As I mentioned at the beginning of this chapter, Windows CE doesn't support the concept of drive letters so familiar to MS-DOS and Windows users. Instead, file storage devices such as PC Cards or even hard disks are shown as directories in the root directory. That leads to the question, "How can you tell a directory from a drive?" To do this, you need to look at the file attributes for the directory. Directories that are actually secondary storage devices—that is, they store files in a place other than the object store—have the file attribute flag FILE_ATTRIBUTE_TEMPORARY set. Windows CE also uses this attribute flag for other "nondirectory" directories such as the NETWORK and RELEASE folders. The NETWORK folder lists network shares. The RELEASE folder is used during embedded development. So finding storage devices on any version of Windows CE is fairly easy, as is shown in the following code fragment:
WIN32_FIND_DATA fd; HANDLE hFind; TCHAR szPath[MAX_PATH]; ULARGE_INTEGER lnTotal, lnFree; lstrcpy (szPath, TEXT ("\\*.*")); hFind = FindFirstFile (szPath, &fd); if (hFind != INVALID_HANDLE_VALUE) { do { if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (fd.dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY)) { TCHAR szName[MAX_PATH]; wstrcpy (szName, fd.cFileName); wstrcat (szName, TEXT (\\Vol:)); HANDLE h = CreateFile (szName, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (h != INVALID_HANDLE_VALUE) { CloseHandle (h); // Get the disk space statistics for drive. GetDiskFreeSpaceEx (fd.cFileName, NULL, &lnTotal, &lnFree); } } } while (FindNextFile (hFind, &fd)); FindClose (hFind); }
vvvv
[1] Copyrighted material
Jacques,
Thanks for taking the time to reply. Your answer is not what I was after, however. Let me explain myself more clearly, if I may.
My App is a C# / .NET App. I install it on the device in the \ProgramFiles\MyApp diectory along with the appropriate .NET Compact Framework dlls.
Should I be able to install the App directly on to the SD card and run it from there ? Is there anything special about an App being in the "normal" \Program Files folder as opposed to being in a randomly named folder on the SD card ? What issues might I expect to encounter in running from the SD Card?
I am not afraid to give it a go and find out. However if I can find out beforehand that it can never work, then I won't bother trying.
The DB access is all managed by 3rd party dlls I use - I just use the .NET ADO Framework to read and write to the DB from my App.
Thanks in advance for any reply you might have.
Nick
Good morning Nick,
Let me bring the « Problems with SQL CE database file corruption on G2 Work About Pros » post to your attention, which provides registry information to prevent the SD card to be ejected during power cylcle (suspend/resume).
For my own curiosity, can you let me know why you wish to run your application from the SD card?
Kind regards,Jacques
Hi Jacques,
Thanks again for your reply. The main problem I have is very little storage memory. When my app is in \Program Files\MyApp, I download a database to the App. This database is gradually increasing in size. According to Settings->Memory->System I only have about 27MB in total to play with. (This seems very small in itself, given that a Workabout Pro 3 that I also use for the same App has about 880MB Storage memory). With the database at its current size I only have 0.1 MB free. The machine therefore runs way too slow and the App sometimes fails (the fail msgs are memory specific and never occur on the machine with the larger memory).My thought was to try to run the App (or perhaps store the database) from the SD card to get round this problem.
Incidentally, I did also look at deleting some of the Windows Apps on the device (we never use ppt.exe etc) but they are protected and I am not up on Windows registry hacking to get round this protection.
As ever, any observations on any of the above are appreciated.
Nick Fitzsimons
Nick,
At this point, I would recommend