From: Trevor on 14 Oct 2009 17:11 RAPI is used in desktop programs to interface with Pocket PC/Windows Mobile devices connected via ActiveSync/Windows Mobile Device Center. RAPI2 is an improved interface over RAPI, but it requires you to use COM. You must get a pointer to the IRAPISession object and then you can use that to call IRAPISession->CeRegEnumKeyEx. RAPI1 is just straight C functions like the CeRegEnumKeyEx function you are trying to use. RAPI1 is easier to use in C++, but it is lacking some nice features from RAPI2 like the ability to be notified when devices connect/disconnect & a way to get the GUID for the connected device & more. If your goal is to read the registry from a program running on the mobile device then forget about the CeXXX functions because those are only for RAPI. You can use the same functions you would use in Win32 (for the most part). If you only want to run this code on the device without using the desktop/RAPI interface then you can use RegEnumKeyEx (which does not require RAPI). There is a .NET managed wrapper for RAPI2 on Codeplex (http://rapi2.codeplex.com/). I found an example C++ class to wrap some of the RAPI2 COM interfaces (http://knowledgepointer.wordpress.com/2008/11/01/talking-to-a-windows-mobile-device-rapi-2/). I have very little experience with either of them, but they look good. "Ernst Sauer" <Sauer-Ernst(a)t-online.de> wrote in message news:hb5bfi$gfc$03$1(a)news.t-online.com... > Trevor schrieb: >> Is your project a Win32 desktop project? > > Hm, I think no. > With VS 2005 and WM 6 SDK I'm writing a program > for the PPC (MainFrm, MFC). > This program runs on the PPC and there I want > get the owner name which you normally can see on > the startup screen. > > Is this a job only for .NET, I don't hope so. > > Thanks > Ernst > > > > >> The RAPI API are only used in desktop projects. eVC/Visual Studio define >> UNDER_CE by default for Windows Mobile/Pocket PC projects. Desktop >> projects shouldn't have UNDER_CE defined. >> >> "Ernst Sauer" <Sauer-Ernst(a)t-online.de> wrote in message >> news:hb2s0f$ibs$03$1(a)news.t-online.com... >>> Trevor schrieb: >>>> Try including rapi.h instead of rapi2.h. You should probably link in >>>> rapi.lib as well. >>>> >>> >>> I get the same errors: >>> error C3861: 'CeRegEnumKeyEx': identifier not found >>> ... >>> ... >>> >>> >>> There is an example "pregdmp" in WM 6 SDK. >>> I successfully tested this example. >>> Then I did the same configuration in my projekt, >>> took the test-function >>> void DumpChild(HKEY hKey, int level) >>> from the example and got the errors above. >>> >>> Perhaps it has something to do with the line >>> #ifndef UNDER_CE >>> in rapi.h >>> >>> If I kill this line, I get other errors. >>> >>> ?????? >>> >>> Thanks >>> Ernst >>> >>
From: Erwin Zwart "erwin AT GuruCE DOT on 15 Oct 2009 02:54
Use the RegCreateKeyEx/RegSetValueEx api's to retrieve the registry keys from an application running on the device. check: http://www.pocketpcdn.com/articles/ownerinformation.html Good luck, Erwin Zwart, Check out my blog: http://GuruCE.com/blog GuruCE Microsoft Embedded Partner http://GuruCE.com Consultancy, training and development services. Trevor schreef: > RAPI is used in desktop programs to interface with Pocket PC/Windows > Mobile devices connected via ActiveSync/Windows Mobile Device Center. > RAPI2 is an improved interface over RAPI, but it requires you to use > COM. You must get a pointer to the IRAPISession object and then you can > use that to call IRAPISession->CeRegEnumKeyEx. RAPI1 is just straight C > functions like the CeRegEnumKeyEx function you are trying to use. RAPI1 > is easier to use in C++, but it is lacking some nice features from RAPI2 > like the ability to be notified when devices connect/disconnect & a way > to get the GUID for the connected device & more. > > If your goal is to read the registry from a program running on the > mobile device then forget about the CeXXX functions because those are > only for RAPI. You can use the same functions you would use in Win32 > (for the most part). If you only want to run this code on the device > without using the desktop/RAPI interface then you can use RegEnumKeyEx > (which does not require RAPI). > > There is a .NET managed wrapper for RAPI2 on Codeplex > (http://rapi2.codeplex.com/). I found an example C++ class to wrap some > of the RAPI2 COM interfaces > (http://knowledgepointer.wordpress.com/2008/11/01/talking-to-a-windows-mobile-device-rapi-2/). > I have very little experience with either of them, but they look good. > > "Ernst Sauer" <Sauer-Ernst(a)t-online.de> wrote in message > news:hb5bfi$gfc$03$1(a)news.t-online.com... >> Trevor schrieb: >>> Is your project a Win32 desktop project? >> >> Hm, I think no. >> With VS 2005 and WM 6 SDK I'm writing a program >> for the PPC (MainFrm, MFC). >> This program runs on the PPC and there I want >> get the owner name which you normally can see on >> the startup screen. >> >> Is this a job only for .NET, I don't hope so. >> >> Thanks >> Ernst >> >> >> >> >>> The RAPI API are only used in desktop projects. eVC/Visual Studio >>> define UNDER_CE by default for Windows Mobile/Pocket PC projects. >>> Desktop projects shouldn't have UNDER_CE defined. >>> >>> "Ernst Sauer" <Sauer-Ernst(a)t-online.de> wrote in message >>> news:hb2s0f$ibs$03$1(a)news.t-online.com... >>>> Trevor schrieb: >>>>> Try including rapi.h instead of rapi2.h. You should probably link >>>>> in rapi.lib as well. >>>>> >>>> >>>> I get the same errors: >>>> error C3861: 'CeRegEnumKeyEx': identifier not found >>>> ... >>>> ... >>>> >>>> >>>> There is an example "pregdmp" in WM 6 SDK. >>>> I successfully tested this example. >>>> Then I did the same configuration in my projekt, >>>> took the test-function >>>> void DumpChild(HKEY hKey, int level) >>>> from the example and got the errors above. >>>> >>>> Perhaps it has something to do with the line >>>> #ifndef UNDER_CE >>>> in rapi.h >>>> >>>> If I kill this line, I get other errors. >>>> >>>> ?????? >>>> >>>> Thanks >>>> Ernst >>>> >>> > |