mercredi 11 mars 2015

How to use namespace - Microsoft.Phone.Info - in native C++ on in WP 8.1 or WP 8


I'm working in a native C++ enviroment on WP8.1.


Let's say I want to call a functions like



Microsoft.Phone.Info::DeviceExtendedProperties.GetValue( "DeviceUniqueId" );


The problem is no matter how I try, it didn't pass compile.


I know "Microsoft.Phone.Info" is a name space,


in C# ppl wrote:



using Microsoft.Phone.Info;


but in C++, I tried



using namespace Microsoft.Phone.Info;

void func()
{
DeviceExtendedProperties.GetValue("DeviceUniqueId");
}


didn't pass compile. or



void func()
{
Microsoft.Phone.Info::DeviceExtendedProperties.GetValue("DeviceUniqueId");
}


didn't pass compile.


It keeps telling me something like this



'Microsoft' : illegal use of namespace identifier in expression


so how do I use this namespace properly?


Thank you guys for the reading and answering. :-) I can't find a C++ example for retriving the device ID. :-P




Aucun commentaire:

Enregistrer un commentaire