分类: C/C++
2008-03-13 17:24:04
#include
void DeviceUtils::GetImei(TDes& aImei)
{
#ifndef __WINS__ //真实设备 // This only works on target machine
TPlpVariantMachineId imei;
PlpVariant::GetMachineIdL(imei);
aImei.Copy(imei);
#else //模拟器 // Return a fake IMEI when working on emulator
_LIT(KEmulatorImei, "000000000000000");
aImei.Copy(KEmulatorImei);
#endif
}
然后在mmp文件中添加LIBRARY plpvariant.lib