PC Review


Reply
Thread Tools Rate Thread

CeRunAppAtTime

 
 
jacliffe
Guest
Posts: n/a
 
      1st Apr 2007
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());

}


 
Reply With Quote
 
 
 
 
Erwin Zwart
Guest
Posts: n/a
 
      1st Apr 2007
What does GetLastError() say?

Erwin Zwart

"jacliffe" <(E-Mail Removed)> wrote in message
news:460fcb71$0$22844$(E-Mail Removed)...
> 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());
>
> }
>
>



 
Reply With Quote
 
Guest
Posts: n/a
 
      2nd Apr 2007
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" <(E-Mail Removed)> wrote in message
news:460fcb71$0$22844$(E-Mail Removed)...
> 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());
>
> }
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CeRunAppAtTime Dominic Microsoft Dot NET Compact Framework 1 20th Jul 2006 03:46 PM
CERunAppAtTime - Can it be used to Wake App ? Ciaran Microsoft Dot NET Compact Framework 1 22nd Jun 2004 10:10 PM
How to use CeRunAppAtTime in c# Deepti Nayak via .NET 247 Microsoft Dot NET Compact Framework 2 15th Apr 2004 05:54 PM
CeRunAppAtTime does not work Okire Microsoft Dot NET Compact Framework 4 10th Oct 2003 10:43 PM
Re: CeRunAppAtTime question Brian Microsoft Dot NET Compact Framework 3 2nd Oct 2003 02:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:24 PM.