Re: BackgroundWorker in .NET CF 2.0



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?


.



Relevant Pages

  • shutdown-- Mandrake claims it is insecure?
    ... On thier updates site, Mandrake claims that shutdown is insecure (it can ... be run by a user and shut down all running processes and drop into a ... They are removing it and their usermode package update removes shutdown. ...
    (comp.os.linux.security)
  • shutdown vs. reboot
    ... systems, and effect a reboot. ... graceful shutdown first (ie; runs through all the init stages and shuts ... down running processes), it DOES state that the -q option can be passed ... effect a graceful shutdown. ...
    (comp.unix.solaris)
  • Re: Cannot logoff or reboot a workstation
    ... Virus scan was clean and SpyBot/AdAware fount a couple of cookies only. ... for shutdown -l to logoff a RWW session. ... >> This will force it to kill any running processes and shutdown. ...
    (microsoft.public.windows.server.sbs)
  • IE Hangs when I shutdown
    ... I'm having a problem lately with IE hanging when I shutdown my pc. ... after I close out all IE windows, when I shutdown I get a response saying ... On here I read about HijackThis, so I have run it and here is the ... Running processes: ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: X Button Event?
    ... VC/VB/C# Developer ... Set the MinimizeBox property of the ... >> protected override void Dispose(bool disposing); ...
    (microsoft.public.dotnet.framework.compactframework)

Loading