PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

CPQIsSdCardInsert()

Hi,

i have been having some trouble porting an application from PPC2002 to 2003, especially with the function CPQIsSdCardInsert() on an iPAQ 5550. The function is a part of the CPQUtil library and tells you if an SD/MMC card is inserted or not. Unfortunately, on my iPAQ 5550 it always returns TRUE. On any other iPAQ model i have tested it works correctly, returning FALSE when there is no card in the slot.

Has anyone else experienced this behaviour?

thanks

cryo
Can't you just enumerate storage cards (FindFirstFlashCard) instead of using the proprietary Compaq API?

Dan East
yes i can :-)

thanks for the tip, i had not seen that API. Implemented it and works like a charm now.

cryo
just for the record, here is what HP support told me about this issue:

Cpqutil was the static library used for model <=H39xx.
From H5450 model, we change the architecture of our SDK, and third-party should directly call the ipaqutil.dll.
They have crosscheck the dll, there is no more function related to the detection of SD card. TO detect SD card inserted. You could for example. Check the subkeys from HKLM\Drivers\Active, and check whether one has been created for SD storage card (the card manager is automatically cretated the registry key when SD card is inserted). It should look like this.

[HKEY_LOCAL_MACHINE\Drivers\Active\36]
"Hnd"=dword:009d3700
"Name"="DSK1:" "Key"="\\Drivers\\SDCARD\\ClientDrivers\\Class\\SDMemory_Class"
"Sckt"=dword:00000000
"ClientInfo"=dword:009d3588


Like Dan suggested, i can use the FindFirstFlashCard API to see if there is any card inserted. The difference between that method and the CPQIsSdCardInsert method is that CPQIsSdCardInsert tells me about the status of the SD/MMC card slot on the ipaq, whereas FindFirstFlashCard and a subsequent call to FindNextFlashCard (because on the ipaq only calling FindFirstFlashCard gives you a handle to the "ipaq file store") will return TRUE if either there is an SD/MMC card *or* a CF memory card on a jacket.

cryo