System-wide timer

N

Noble

Hello all,
I am working on an application in VB.Net for the .NetCF. We are using
VS2003. The application needs to have a system wide timer feature. We are
using a kiosk program to make our application the only one the user can use.

We want the ppc to watch and see when there has been no activity for a
period of 2 minutes and then at that time run some routines.

How is the best way to achieve this in VB.Net code?

Thanks in advance,
Noble
 
C

Chris Tacke, eMVP

I'll again suggest that you use an IMessageFilter implementation and the
OpenNETCF ApplicationEx Run method. In the filter, create a timer that you
reset whenever a keypress/mouse event occurs. When the timer fires, then
you've gotten the timeout.

I know an example was posted here before. I think Paul Tobey or Peter Foot
posted it. A search for MessageFilter and Timer may get you there.
 
N

Noble

Thanks Chris.
I have been having trouble getting the OpenNETCF control to work correctly
for me. Some kind of compile error message comes up when I am compiling my
program with the control in it. I cannot remember what it says but I know
when I remove the control everything works fine. I will try again and see
what happens.
 
N

Noble

Chris,
This is what I get when I try and compile my program:

Error: The dependency 'mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=969db8053d3322ac' in project 'FarmN-Beta' cannot be copied to
the run directory because it would conflict with dependency 'mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.


Error: The dependency 'mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' in project 'FarmN-Beta' cannot be copied to
the run directory because it would conflict with dependency 'mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=969db8053d3322ac'.


C:\SimpleN\DotNet\FarmN-Beta\frmMultiTicket.vb(376): 'Player' is ambiguous
in the namespace 'OpenNETCF.Multimedia.Audio'.


C:\SimpleN\DotNet\FarmN-Beta\frmVoiceTicket.vb(216): 'Recorder' is ambiguous
in the namespace 'OpenNETCF.Multimedia.Audio'.


The last two errors are generated because I have an older Multimedia version
of OpenNETCF running. Not the entire OpenNETCF just the multi-media portion.
I got it when you could just download that portion by itself.

Please help and thanks in advance,
Noble
 
N

Noble

This messge topic is about a serial foot switch or something. Are you sure
it is the correct one??
 
N

Noble

Ok, here is the last error that I am getting:
C:\SimpleN\DotNet\FarmN-Beta\frmVoiceTicket.vb(473): Value of type
'System.UInt16' cannot be converted to 'Short'.

???
Thanks in advance...
 
C

Chris Tacke, eMVP

Looks like you're trying to pass a Short (signed 16-bit number) to a method
that's looking for a UInt16 (unsigned 16-bit number) on line 473 of
frmVoiceTicket.vb
 
N

Noble

Yup! You are right. In the old MultiMedia Code it worked like this:

Private recorder As OpenNETCF.Multimedia.Audio.Recorder

Private seconds As UInt16 = Convert.ToUInt16("5")

recorder.RecordFor(filestream, seconds)



Has this format changed??
 
N

Noble

A Big Thank You Chris!! I have OpenNETCF up and running now I can tackle
the timer issue.

Thanks again for all your help Chris!!!

Noble

Chris Tacke said:
Looking at the docs at www.opennetcf.org/library I see it takes a short. It
was probably changed to make it CLS-compliant so you don't have to do the
ungainly conversion.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Noble said:
Yup! You are right. In the old MultiMedia Code it worked like this:

Private recorder As OpenNETCF.Multimedia.Audio.Recorder

Private seconds As UInt16 = Convert.ToUInt16("5")

recorder.RecordFor(filestream, seconds)



Has this format changed??





Are
you cannot cannot
'Player'
is 'Recorder'
control
to
work
correctly
for me. Some kind of compile error message comes up when
I
am
compiling
my
program with the control in it. I cannot remember what
it
says
 
N

Noble

That did the trick!!! Thanks a million!! I will give credit in the program
for your efforts.

Thanks again,
Noble

Chris Tacke said:
I've got it working in VB. Took me longer to figure out the VB syntax than
to actually implement it, but it's done. You can find it here:

http://wiki.opennetcf.org/ow.asp?AppIdleTimer

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Noble said:
Yup! You are right. In the old MultiMedia Code it worked like this:

Private recorder As OpenNETCF.Multimedia.Audio.Recorder

Private seconds As UInt16 = Convert.ToUInt16("5")

recorder.RecordFor(filestream, seconds)



Has this format changed??





Are
you cannot cannot
'Player'
is 'Recorder'
control
to
work
correctly
for me. Some kind of compile error message comes up when
I
am
compiling
my
program with the control in it. I cannot remember what
it
says
 

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