×
Namespaces

Variants
Actions
(Difference between revisions)

How to check if device has memory card or not

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot addition of Template:ArticleMeta)
hamishwillee (Talk | contribs)
m (Hamishwillee - Adding missing translation link)
Line 53: Line 53:
 
[[Category:How To]]
 
[[Category:How To]]
 
[[Category:Code Examples]][[Category:Hardware]][[Category:Media]][[Category:Porting]]
 
[[Category:Code Examples]][[Category:Hardware]][[Category:Media]][[Category:Porting]]
 +
<!-- Translation --> [[pt:Como verificar se o dispositivo tem ou não cartão de memória]]

Revision as of 07:32, 16 December 2011

Article Metadata
Article
Created: rathodavinash (28 Jun 2007)
Last edited: hamishwillee (16 Dec 2011)
The following simple code tells if a device has a memory card or not.
{{{width}}}
TBool CMyContainer::HasMMC()
{
TBool iHasMMC;
iHasMMC=EFalse;
 
RFs fileSession;
fileSession.Connect();
 
TDriveInfo i;
if (fileSession.Drive(i, EDriveE)==KErrNone) {
if (i.iType!=EMediaNotPresent &&
i.iType!=EMediaUnknown &&
i.iType!=EMediaCdRom &&
i.iType!=EMediaRom) {
// memory card
iHasMMC=ETrue;
}
}
fileSession.Close();
return iHasMMC;
}

Thanks to Mika Raento for this code.

Internal Links:

71 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×