Service with .NET Compoact Framework

K

Karsten Baumann

Hello NG,

I have developed a program that runs continuously in the background and
check the system date. At a certain Dateum it should issue a message. How do
I solve the problem best. Is an loop or some kind of service useful.

Thanks for the help!
Karsten
 
P

Paul G. Tobey [eMVP]

What problem are you trying to solve? That is, I don't see any problem
described in your message. You don't know how to "issue a message"? Or you
don't know how to be triggered at a given date/time?

The issue a message thing is probably answered by using the Notification
Manager in Windows CE, but that doesn't exist in all versions of the
operating system and you haven't told us what you're using.

CeRunAppAtTime() is probably what you want to trigger some action at a given
date/time. You have to P/Invoke it, as far as I know.

Paul T.
 
K

Karsten Baumann

Paul G. Tobey said:
What problem are you trying to solve? That is, I don't see any problem
described in your message. You don't know how to "issue a message"? Or
you
don't know how to be triggered at a given date/time?

The issue a message thing is probably answered by using the Notification
Manager in Windows CE, but that doesn't exist in all versions of the
operating system and you haven't told us what you're using.

CeRunAppAtTime() is probably what you want to trigger some action at a
given
date/time. You have to P/Invoke it, as far as I know.

Paul T.

Thanks for your answer! I use CeRunAppAtTime. Its works fine, but with VB
..NET the device doesnt wake up?

Karsten
 
P

Paul G. Tobey [eMVP]

CeRunAppAtTime() is what alarms of all sorts use. Does your device work,
waking up at the right time? That is, forget VB.NET and build a C
application that just sets up to load some application, WordPad or File
Explorer or whatever, at a given time, and verify that the device wakes up
and the program runs. If not, you have a device/OS problem and no amount of
screwing around with the .NET CF code will fix it.

If the device does work correctly when your VB.NET code is not involved,
then look at how you called CeRunAppAtTime(), your parameters, how you
declared the function for P/Invoke (particularly any parameter types).

If everything looks fine with the P/Invoke, when are you setting the
CeRunAppAtTime() to run? That is, you can't use this to schedule a run five
seconds in the future; that won't work. Setting it for ten minutes in the
future is a good test.

Paul T.
 
K

Karsten Baumann

Paul G. Tobey said:
CeRunAppAtTime() is what alarms of all sorts use. Does your device work,
waking up at the right time? That is, forget VB.NET and build a C
application that just sets up to load some application, WordPad or File
Explorer or whatever, at a given time, and verify that the device wakes up
and the program runs. If not, you have a device/OS problem and no amount
of
screwing around with the .NET CF code will fix it.

If the device does work correctly when your VB.NET code is not involved,
then look at how you called CeRunAppAtTime(), your parameters, how you
declared the function for P/Invoke (particularly any parameter types).

If everything looks fine with the P/Invoke, when are you setting the
CeRunAppAtTime() to run? That is, you can't use this to schedule a run
five
seconds in the future; that won't work. Setting it for ten minutes in the
future is a good test.

Paul T.


Thank You!

CeRunAppAtTime is the best function for my app.

Karsten
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top