Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

System time(minute) change event doesn't raise per minute.

 
   PDA (Home) -> Pocket PC - Developer RSS
Next:  How to add an icon in the taskbar of smartphone w..  
Author Message
Luckcao

External


Since: Jul 04, 2007
Posts: 2



(Msg. 1) Posted: Wed Jul 04, 2007 7:12 am
Post subject: System time(minute) change event doesn't raise per minute.
Archived from groups: microsoft>public>pocketpc>developer (more info?)

I wrote the following code to write the current datetime into a txt file per
minute in .Net CF2.0 version:

SystemState s = new SystemState(SystemProperty.Time);
s.Changed += new ChangeEventHandler(s_Changed);

void s_Changed(object sender, ChangeEventArgs args)
{
FileStream fsMyfile = new FileStream("\Program Files\Sender\1.txt",
FileMode.Append, FileAccess.Write);
StreamWriter swMyfile = new StreamWriter(fsMyfile);
swMyfile.WriteLine("CurrentDateTime:" + DateTime.Now.ToString());
swMyfile.Flush();
swMyfile.Close();
}

I wrote this code according to the sample in WM6 SDK.
But, after few hours, I checked the txt file, it didn't write the system
time per minute.
The Actual Results as follow:
CurrentDateTime:07-6-30 17:37:02
CurrentDateTime:07-6-30 17:38:02
CurrentDateTime:07-6-30 17:39:02
CurrentDateTime:07-6-30 19:03:38
CurrentDateTime:07-6-30 19:04:03
CurrentDateTime:07-6-30 19:05:03
CurrentDateTime:07-6-30 19:10:51
CurrentDateTime:07-6-30 19:11:02
CurrentDateTime:07-6-30 19:12:02
CurrentDateTime:07-6-30 19:13:02

During 07-6-30 17:39:02 to 07-6-30 19:03:38, I didn't use my mobile. So, I
think, maybe it's the problem.

Then I tried the System.Threading.Timer also. It's same problem as above.
When the screen turn off, then the system will not raise the timer tick event
again.

I don't know it's the .Net CF2.0's bug or not.

So, I submit it here.

Could you help me on it?

Thanks a lot!

=============================
btw, What I want to do is to monitor a directory, If got any file, then
process it and cut it to other folder.

It looks like a Service. Right?
I found a lot of documents that talk about how to create Service in VC++,
but, I don't know anything about VC++, I just know C#.

Could you teach me to create a service by C#?
Back to top
Login to vote
RDub

External


Since: Jul 05, 2007
Posts: 2



(Msg. 2) Posted: Thu Jul 05, 2007 10:03 am
Post subject: Re: System time(minute) change event doesn't raise per minute. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

My understanding is that when the device turns itself off (after whatever
the defined timeout is) it is OFF. PERIOD! That is the processor is not
processing any instructions, and so therefore is not running any of your
code. What is it you are tying to accomplish?

Ron W


"Luckcao" <Luckcao RemoveThis @discussions.microsoft.com> wrote in message
news:C338EB32-2F1C-41E5-9017-062B7C12BEBF@microsoft.com...
>I wrote the following code to write the current datetime into a txt file
>per
> minute in .Net CF2.0 version:
>
> SystemState s = new SystemState(SystemProperty.Time);
> s.Changed += new ChangeEventHandler(s_Changed);
>
> void s_Changed(object sender, ChangeEventArgs args)
> {
> FileStream fsMyfile = new FileStream("\Program Files\Sender\1.txt",
> FileMode.Append, FileAccess.Write);
> StreamWriter swMyfile = new StreamWriter(fsMyfile);
> swMyfile.WriteLine("CurrentDateTime:" + DateTime.Now.ToString());
> swMyfile.Flush();
> swMyfile.Close();
> }
>
> I wrote this code according to the sample in WM6 SDK.
> But, after few hours, I checked the txt file, it didn't write the system
> time per minute.
> The Actual Results as follow:
> CurrentDateTime:07-6-30 17:37:02
> CurrentDateTime:07-6-30 17:38:02
> CurrentDateTime:07-6-30 17:39:02
> CurrentDateTime:07-6-30 19:03:38
> CurrentDateTime:07-6-30 19:04:03
> CurrentDateTime:07-6-30 19:05:03
> CurrentDateTime:07-6-30 19:10:51
> CurrentDateTime:07-6-30 19:11:02
> CurrentDateTime:07-6-30 19:12:02
> CurrentDateTime:07-6-30 19:13:02
>
> During 07-6-30 17:39:02 to 07-6-30 19:03:38, I didn't use my mobile. So, I
> think, maybe it's the problem.
>
> Then I tried the System.Threading.Timer also. It's same problem as above.
> When the screen turn off, then the system will not raise the timer tick
> event
> again.
>
> I don't know it's the .Net CF2.0's bug or not.
>
> So, I submit it here.
>
> Could you help me on it?
>
> Thanks a lot!
>
> =============================
> btw, What I want to do is to monitor a directory, If got any file, then
> process it and cut it to other folder.
>
> It looks like a Service. Right?
> I found a lot of documents that talk about how to create Service in VC++,
> but, I don't know anything about VC++, I just know C#.
>
> Could you teach me to create a service by C#?
>
Back to top
Login to vote
user

External


Since: Oct 11, 2007
Posts: 94



(Msg. 3) Posted: Thu Jul 05, 2007 10:27 am
Post subject: Re: System time(minute) change event doesn't raise per minute. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

It's not a bug, that's normal device behavior. When the device suspends,
the processor clock stops. If you want it to continue running, call
SystemIdleTimerReset to reset the idle timer (this will kill your battery
fast) or use a notification to wake every minute and do the work. We wrote
our LargeIntervalTimer in the Smart Device Framework (2.1 and later) for
this type of scenario:

http://blog.opennetcf.org/ctacke/PermaLink,guid,169fcc25-a42f-4a8f-b8a...b6c85d8


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com




"Luckcao" <Luckcao DeleteThis @discussions.microsoft.com> wrote in message
news:C338EB32-2F1C-41E5-9017-062B7C12BEBF@microsoft.com...
>I wrote the following code to write the current datetime into a txt file
>per
> minute in .Net CF2.0 version:
>
> SystemState s = new SystemState(SystemProperty.Time);
> s.Changed += new ChangeEventHandler(s_Changed);
>
> void s_Changed(object sender, ChangeEventArgs args)
> {
> FileStream fsMyfile = new FileStream("\Program Files\Sender\1.txt",
> FileMode.Append, FileAccess.Write);
> StreamWriter swMyfile = new StreamWriter(fsMyfile);
> swMyfile.WriteLine("CurrentDateTime:" + DateTime.Now.ToString());
> swMyfile.Flush();
> swMyfile.Close();
> }
>
> I wrote this code according to the sample in WM6 SDK.
> But, after few hours, I checked the txt file, it didn't write the system
> time per minute.
> The Actual Results as follow:
> CurrentDateTime:07-6-30 17:37:02
> CurrentDateTime:07-6-30 17:38:02
> CurrentDateTime:07-6-30 17:39:02
> CurrentDateTime:07-6-30 19:03:38
> CurrentDateTime:07-6-30 19:04:03
> CurrentDateTime:07-6-30 19:05:03
> CurrentDateTime:07-6-30 19:10:51
> CurrentDateTime:07-6-30 19:11:02
> CurrentDateTime:07-6-30 19:12:02
> CurrentDateTime:07-6-30 19:13:02
>
> During 07-6-30 17:39:02 to 07-6-30 19:03:38, I didn't use my mobile. So, I
> think, maybe it's the problem.
>
> Then I tried the System.Threading.Timer also. It's same problem as above.
> When the screen turn off, then the system will not raise the timer tick
> event
> again.
>
> I don't know it's the .Net CF2.0's bug or not.
>
> So, I submit it here.
>
> Could you help me on it?
>
> Thanks a lot!
>
> =============================
> btw, What I want to do is to monitor a directory, If got any file, then
> process it and cut it to other folder.
>
> It looks like a Service. Right?
> I found a lot of documents that talk about how to create Service in VC++,
> but, I don't know anything about VC++, I just know C#.
>
> Could you teach me to create a service by C#?
>
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Calllog Event - Hello I can get an event when I have a missedcall and when an incomming call is happening. But how can I just have an event when the calllog has been changed? Because the incomming call event fires when: 1. The incomming call appears 2. The incomming...

wakeup event - I'd like to call a method in my code on the wakeup event, I see how to call an application, but having a hard time getting an example of creating the event for wakeup, and calling a method when that event is triggerd... Also, does anyone have a good..

FormLoaded Event - Any ideas on how to get something like Form.Loaded event? I need to do some task automatically right after the form is loaded and ready for user interacion.

Second CTreeCtrl selchange event - Hi. I have a custom tree ctrl based on CTreeCtrl. When I select an item, the item is marked, and I get the OnSelchanged event. However, if I click the same, selected item once again, I get no event. I have tried different events, and the only one I..

Timer event problem - Hi, I have notices a strange behavior using both the System.Windows.Forms.Timer and the System.Threading.Timer objects. I have WM2003SE application developed on VS2005. This application contains a timer, which is setup to expire exactly 1 mimute afte...
       PDA (Home) -> Pocket PC - Developer All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
 Linux Forums
 Mac Forums
  PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact