Click here to Skip to main content
15,912,400 members
Home / Discussions / C#
   

C#

 
GeneralRe: Removing leading zeros from negative string Pin
PIEBALDconsult13-Apr-10 13:15
mvePIEBALDconsult13-Apr-10 13:15 
GeneralRe: Removing leading zeros from negative string Pin
Paw Jershauge13-Apr-10 20:28
Paw Jershauge13-Apr-10 20:28 
GeneralRe: Removing leading zeros from negative string Pin
PIEBALDconsult13-Apr-10 13:29
mvePIEBALDconsult13-Apr-10 13:29 
GeneralRe: Removing leading zeros from negative string Pin
Paw Jershauge13-Apr-10 20:33
Paw Jershauge13-Apr-10 20:33 
GeneralRe: Removing leading zeros from negative string Pin
PIEBALDconsult14-Apr-10 3:12
mvePIEBALDconsult14-Apr-10 3:12 
QuestionStopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 9:42
Jacob Dixon12-Apr-10 9:42 
AnswerRe: Stopping threads (semi-safely).... Pin
PIEBALDconsult12-Apr-10 9:58
mvePIEBALDconsult12-Apr-10 9:58 
AnswerRe: Stopping threads (semi-safely).... Pin
Dave Kreskowiak12-Apr-10 9:59
mveDave Kreskowiak12-Apr-10 9:59 
You can close the form all you want so long as your WMI retrieval code doesn't update a control on the form. Your code should be generating a liost of applications and populating a collection with that data, NOT a control on a form. This way, you've completely disconnected the data from the UI.

Your code can supply an event to signal the form code that the collection has been completely populated, then the form can bind the display control to that data collection. When the form closes, it can remove the handler it registered, so, when the event tries to fire, it sees that it has no subscribers and doesn't do anything.

In other words, you can leave the data collection code running and not worry about killing the thread and possibly screwing up WMI provider in the process.

A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008
But no longer in 2009...




GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 10:16
Jacob Dixon12-Apr-10 10:16 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 10:51
Jacob Dixon12-Apr-10 10:51 
GeneralRe: Stopping threads (semi-safely).... Pin
PIEBALDconsult12-Apr-10 13:02
mvePIEBALDconsult12-Apr-10 13:02 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 13:39
Jacob Dixon12-Apr-10 13:39 
GeneralRe: Stopping threads (semi-safely).... Pin
PIEBALDconsult12-Apr-10 13:51
mvePIEBALDconsult12-Apr-10 13:51 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 13:58
Jacob Dixon12-Apr-10 13:58 
GeneralRe: Stopping threads (semi-safely).... Pin
PIEBALDconsult12-Apr-10 14:15
mvePIEBALDconsult12-Apr-10 14:15 
GeneralRe: Stopping threads (semi-safely).... Pin
Dave Kreskowiak12-Apr-10 15:33
mveDave Kreskowiak12-Apr-10 15:33 
AnswerRe: Stopping threads (semi-safely).... Pin
William Winner12-Apr-10 10:23
William Winner12-Apr-10 10:23 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 10:27
Jacob Dixon12-Apr-10 10:27 
GeneralRe: Stopping threads (semi-safely).... Pin
Luc Pattyn12-Apr-10 10:55
sitebuilderLuc Pattyn12-Apr-10 10:55 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 11:14
Jacob Dixon12-Apr-10 11:14 
GeneralRe: Stopping threads (semi-safely).... Pin
Luc Pattyn12-Apr-10 11:23
sitebuilderLuc Pattyn12-Apr-10 11:23 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 11:27
Jacob Dixon12-Apr-10 11:27 
GeneralRe: Stopping threads (semi-safely).... Pin
Luc Pattyn12-Apr-10 11:40
sitebuilderLuc Pattyn12-Apr-10 11:40 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 11:23
Jacob Dixon12-Apr-10 11:23 
GeneralRe: Stopping threads (semi-safely).... Pin
William Winner12-Apr-10 11:01
William Winner12-Apr-10 11:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.