Link to home
Start Free TrialLog in
Avatar of cynkan
cynkanFlag for Sweden

asked on

How to run a thread when using .ShowDialog in CF

Hi,
I have a Compact Framework 3.5 application and I need to log to a webservice even if the user has a another form open with .ShowDialog
Is there a way to make a new thread running every 5 minutes?

Rgds
Cynkan
Avatar of daveamour
daveamour
Flag of United Kingdom of Great Britain and Northern Ireland image

Are there any Timers in CF?
Avatar of cynkan

ASKER

Yes, there are timers in CF.
So would one of them not do the trick?
Avatar of cynkan

ASKER

No becourse the user has a .ShowDialog form open the mainforms timer would not tick. Thats why I was thinking of making a separate thread for this timer.
Ok I see well if that is definatley the case then yes just use a different thread.
Le me see if I canknock something together...
Avatar of cynkan

ASKER

Thanks, that would be great. I tried to understand how to make a different thread for a timer thats not affect the frozen mainform when using .showdialog.
I've just tried this with a timer and a ShowDialog and it worked - this was on Winforms though and not CF.  Have you tried this yourself to check that it doesn't tick when the form is shown as ShowDialog?
Avatar of cynkan

ASKER

Yes, it works fine in WinForms but not in CF 3.5.
Ok so to tinker with this I will create a SmartDevice app in Visual Studio 2008.
Give me a few mins...
 
ASKER CERTIFIED SOLUTION
Avatar of daveamour
daveamour
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cynkan

ASKER

Hmm, its something in my project that make this not to work. I tested with a new project and it does work. I have to error trap and see whats happening.
Many thanks for your excellent assistance!
Your welcome and thanks for the points.