Re: BackgroundWorker in .NET CF 2.0
- From: "davis" <davisford@xxxxxxxxx>
- Date: 9 Dec 2006 21:23:31 -0800
Hi Chris, Thanks for the response.
Quick follow-up question...I'm not a wizard with this...still learning.
I tried using a thread pool to get the job done.
So, I have the method like this:
private void initDebug(object state) {
/* init debug TCP console here */
}
and in the main form constructor I have:
ThreadPool.QueueUserWorkItem(initDebug);
This seems to work ok...however when I kill the application, and I try
to re-deploy, I notice that it fails because the DLL i use for tcp
debug is in use.
I learned the hard way about the MinimizeBox property on CF forms. So,
I set this property to false, and I override the OnClosing method with
this:
protected override void OnClosing(CancelEventArgs e) {
e.Cancel = ShutDown( );
base.OnClosing(e);
}
where ShutDown( ) is my own method that tries to dispose of all
threads, sockets, etc.
It catches any exceptions and returns false if caught, otherwise it
returns true.
So, when I close the application, I see that the process is not listed
in the running processes on the PocketPc, but still, something has a
hold on this DLL, which leads me to have to reboot the device every
time.
Any ideas on what I'm doing wrong here?
Thanks in advance,
davis
<ctacke/> wrote:
Create a thread. It's really not difficult. But there's also the SDF:
http://www.opennetcf.com/library/sdf/OpenNETCF.ComponentModel.BackgroundWorkerMembers.html
--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--
"davis" <davisford@xxxxxxxxx> wrote in message
news:1165721904.112835.165860@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi, I guess there is no BackgroundWorker in CF 2.0, but is there some
other easy way to launch a quick background thread task from the UI?
I have a debug console logger, and it takes a while to fire up and
connect to a remote TCP server...and when it starts up, it causes
program start lag.
I could --
a) Add a UI control to initialize it
b) Spawn a new Thread(ThreadStart(initLogger));
Is there a better way?
.
- Follow-Ups:
- Re: BackgroundWorker in .NET CF 2.0
- From: Daniel Moth
- Re: BackgroundWorker in .NET CF 2.0
- References:
- BackgroundWorker in .NET CF 2.0
- From: davis
- Re: BackgroundWorker in .NET CF 2.0
- From: <ctacke/>
- BackgroundWorker in .NET CF 2.0
- Prev by Date: Re: BackgroundWorker in .NET CF 2.0
- Next by Date: Re: BackgroundWorker in .NET CF 2.0
- Previous by thread: Re: BackgroundWorker in .NET CF 2.0
- Next by thread: Re: BackgroundWorker in .NET CF 2.0
- Index(es):
Relevant Pages
|
Loading