CeRunAppAtTime  
Author Message
gfernandez





PostPosted: Sun Apr 01 13:35:16 CDT 2007 Top

Compact >> CeRunAppAtTime Could anyone please help? The following code when run always returns false
for CeRunAppAtTime. Would anyone know why?

Many thanks

john









public struct SystemTime

{public UInt16 Year;

public UInt16 Month;

public UInt16 DayOfWeek;

public UInt16 Day;

public UInt16 Hour;

public UInt16 Minute;

public UInt16 Second;

public UInt16 MilliSecond;



}



[DllImport("CoreDll.dll")]

public static extern bool CeRunAppAtTime(string runpro, SystemTime
threemin);


[MTAThread]

static void Main()

{

bool testrunapp;

string path = @"windows\calc.exe";

if (File.Exists(path))

{

SystemTime dtNextRunTime = new SystemTime();



dtNextRunTime.Year = 2007;

dtNextRunTime.Month = 4;

dtNextRunTime.DayOfWeek = 1;

dtNextRunTime.Day = 2;

dtNextRunTime.Hour = 1;

dtNextRunTime.Minute = 35;

dtNextRunTime.Second = 35;

dtNextRunTime.MilliSecond = 0;



testrunapp = CeRunAppAtTime(path, dtNextRunTime);

)







Application.Run(new Form1());

}

Information Technology123  
 
 
Erwin





PostPosted: Sun Apr 01 13:35:16 CDT 2007 Top

Compact >> CeRunAppAtTime What does GetLastError() say?

Erwin Zwart

"jacliffe" <EMail@HideDomain.com> wrote in message
news:460fcb71$0$22844$EMail@HideDomain.com...
> Could anyone please help? The following code when run always returns
> false for CeRunAppAtTime. Would anyone know why?
>
> Many thanks
>
> john
>
>
>
>
>
>
>
>
>
> public struct SystemTime
>
> {public UInt16 Year;
>
> public UInt16 Month;
>
> public UInt16 DayOfWeek;
>
> public UInt16 Day;
>
> public UInt16 Hour;
>
> public UInt16 Minute;
>
> public UInt16 Second;
>
> public UInt16 MilliSecond;
>
>
>
> }
>
>
>
> [DllImport("CoreDll.dll")]
>
> public static extern bool CeRunAppAtTime(string runpro, SystemTime
> threemin);
>
>
> [MTAThread]
>
> static void Main()
>
> {
>
> bool testrunapp;
>
> string path = @"windows\calc.exe";
>
> if (File.Exists(path))
>
> {
>
> SystemTime dtNextRunTime = new SystemTime();
>
>
>
> dtNextRunTime.Year = 2007;
>
> dtNextRunTime.Month = 4;
>
> dtNextRunTime.DayOfWeek = 1;
>
> dtNextRunTime.Day = 2;
>
> dtNextRunTime.Hour = 1;
>
> dtNextRunTime.Minute = 35;
>
> dtNextRunTime.Second = 35;
>
> dtNextRunTime.MilliSecond = 0;
>
>
>
> testrunapp = CeRunAppAtTime(path, dtNextRunTime);
>
> )
>
>
>
>
>
>
>
> Application.Run(new Form1());
>
> }
>
>


 
 
ctacke/>





PostPosted: Mon Apr 02 07:24:15 CDT 2007 Top

Compact >> CeRunAppAtTime Sure, look at the API definition. It tkes a SYSTEMTIME*, you passing it a
SYSTEMTIME. Pass the struct as ref or make it a class.


--
Chris Tacke - Embedded MVP
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--



"jacliffe" <EMail@HideDomain.com> wrote in message
news:460fcb71$0$22844$EMail@HideDomain.com...
> Could anyone please help? The following code when run always returns
> false for CeRunAppAtTime. Would anyone know why?
>
> Many thanks
>
> john
>
>
>
>
>
>
>
>
>
> public struct SystemTime
>
> {public UInt16 Year;
>
> public UInt16 Month;
>
> public UInt16 DayOfWeek;
>
> public UInt16 Day;
>
> public UInt16 Hour;
>
> public UInt16 Minute;
>
> public UInt16 Second;
>
> public UInt16 MilliSecond;
>
>
>
> }
>
>
>
> [DllImport("CoreDll.dll")]
>
> public static extern bool CeRunAppAtTime(string runpro, SystemTime
> threemin);
>
>
> [MTAThread]
>
> static void Main()
>
> {
>
> bool testrunapp;
>
> string path = @"windows\calc.exe";
>
> if (File.Exists(path))
>
> {
>
> SystemTime dtNextRunTime = new SystemTime();
>
>
>
> dtNextRunTime.Year = 2007;
>
> dtNextRunTime.Month = 4;
>
> dtNextRunTime.DayOfWeek = 1;
>
> dtNextRunTime.Day = 2;
>
> dtNextRunTime.Hour = 1;
>
> dtNextRunTime.Minute = 35;
>
> dtNextRunTime.Second = 35;
>
> dtNextRunTime.MilliSecond = 0;
>
>
>
> testrunapp = CeRunAppAtTime(path, dtNextRunTime);
>
> )
>
>
>
>
>
>
>
> Application.Run(new Form1());
>
> }
>
>