Querying
a Single Feature Dynamically Using CFeatureDiscovery
How to query a feature using CFeatureDiscovery dynamically.
To query whether
a feature is supported using CFeatureDiscovery dynamically,
take the following steps.
Determine the Uid of the feature.
- Create an instance
of CFeatureDiscovery thus,
// Dynamic way of using the class using NewL():
// Call NewL() to create an instance of CFeatureDiscovery.
CFeatureDiscovery* testA = CFeatureDiscovery::NewL();
or thus
// Dynamic way of using the class using NewLC():
// Call NewLC() to create an instance of CFeatureDiscovery.
// The method leaves the instance of the object on the cleanup stack.
CFeatureDiscovery* testB = CFeatureDiscovery::NewLC();
- call its IsSupported() function
with the Uid of the feature as argument, and
// Call the exported IsSupported() method to query whether features
// are supported in the current environment or not.
TBool usbSupported = testA->IsSupported(<featureUIDx>);
TBool mmcSupported = testA->IsSupported(<featureUIDx>);
delete the instance of CFeatureDiscovery if it was
not created using NewLC().
// Delete the created instance of CFeatureDiscovery.
delete testA;
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.