Q: How can I determine my CE build number programmatically?
The ADS CE Build number is stored in the device registry. Below is an example for reading it on the BitsyX. For other platforms you will have to change the key name that you open in the call to RegOpenKeyEx.
HKEY key; DWORD size = 0; TCHAR *value;
// open the key RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("\\Platform\\BITSYX"), 0, 0, &key);
// determine the length of the value RegQueryValueEx(key, _T("ADSCEVersion"), 0, NULL, NULL, &size);
// allocate a buffer value = new TCHAR[size];
// get value RegQueryValueEx(key, _T("ADSCEVersion"), 0, NULL, (BYTE*)value, &size);
RETAILMSG(1, (_T("ADS CE Build number: %s\r\n"), value));
// free the buffer delete value;
// close the reg key RegCloseKey(key);
|