Link to home
Start Free TrialLog in
Avatar of JoseM20
JoseM20

asked on

How Set PPC Date Time from Desktop Application

Hi, I've been trying hard to set the PPC date and time information from a desktop application in c#.Net 2008. I am new to mobile development and I really don't have an idea of how to accomplish this. I have tried using rapi.Invoke coredll.dll SetSystemTime (using OpenNETCF.Desktop.Communication) but without any success. Is there a way to do this? I did a lot of google search but didn't find anything. Please help me I am totally lost!!. Thanks
ASKER CERTIFIED SOLUTION
Avatar of alexey_gusev
alexey_gusev
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JoseM20
JoseM20

ASKER

I am going to try this even though I have no idea on hoe to use CeCreateProcess().
Can I use OpenNetCF? I I use it I will have to copy the dll to the device with the .exe?

Thanks for your reply!
yes, you can use OpenNETCF for that (if I remember correctly their Desktop.Communication package has some wrappers for that).

the exe I mentioned is Windows Mobile application, so you should copy whatever needed to run it properly, ie if it wil be in c# then it should run properly if you launch it manually. RAPI will just allow you starting it from desktop side instead of PPC
Avatar of hjgode
Although this is not C# code, take a look at psynctime of itsutils at http://www.xs4all.nl/~itsme/projects/xda/tools.html.

Psynctime uses ActiveSync to copy itsutils.dll to device and then calls a function in the DLL to set the device time to the time of the connected PC.

The source of psynctime is here http://nah6.com/~itsme/cvs-xdadevtools/itsutils/src/psynctime.cpp

In a C# app, you could use itsutils.dll and copy it over to the device using RAPI function (CeCopyFile). Then do a remote call to the DLLs setsystemtime function. Or copy aan exe to the device and then let the exe call the DLL function or call SetSystemTime directly.

Unfortunately there is no CeSetSystemTime API ready for use (http://msdn.microsoft.com/en-us/library/ms860183.aspx). You have to either use a remote DLL call or a remote process to set the device's system time.