Click here to Skip to main content
15,890,438 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Question on how to trap winform closing from VS designer Pin
Jon_Boy16-Mar-11 1:43
Jon_Boy16-Mar-11 1:43 
AnswerRe: Question on how to trap winform closing from VS designer Pin
Luc Pattyn15-Mar-11 4:24
sitebuilderLuc Pattyn15-Mar-11 4:24 
AnswerRe: Question on how to trap winform closing from VS designer Pin
Аslam Iqbal15-Mar-11 8:14
professionalАslam Iqbal15-Mar-11 8:14 
AnswerRe: Question on how to trap winform closing from VS designer Pin
Gregory Gadow15-Mar-11 12:46
Gregory Gadow15-Mar-11 12:46 
QuestionA quick threading question Pin
Alan Burkhart14-Mar-11 19:50
Alan Burkhart14-Mar-11 19:50 
AnswerRe: A quick threading question Pin
Groulien14-Mar-11 21:28
Groulien14-Mar-11 21:28 
GeneralRe: A quick threading question Pin
Alan Burkhart15-Mar-11 4:52
Alan Burkhart15-Mar-11 4:52 
AnswerRe: A quick threading question Pin
Luc Pattyn15-Mar-11 0:01
sitebuilderLuc Pattyn15-Mar-11 0:01 
I have a number of comments:

1.
I don't like Thread.Abort() as it may leave things in an unknown state. I prefer a cooperative way of terminating a thread, which implies the thread code itself checks an exit condition regularly (requiring some code, and causing some exit delay).

Note: when cooperative, you don't need a new thread each time, it could simply switch to the new job when leaving the old one.

2.
I detest empty catch blocks, I do appreciate you had a comment in there.
If all it does is cope with MakeThms possibly being Nothing, then better test for that explicitly.

3.
lvFiles.Invalidate() is forbidden in anything but the main thread. Don't tell me you are either running a very old .NET version (1.x) or have set lvFiles.CheckForIllegalCrossThreadCalls false? For your penitence read this[^].

4.
when using real Thread instances you should consider setting IsBackground true; if not such running thread could prevent your app from exiting when the main form gets closed.

5.
This situation would be better served by a BackgroundWorker which solves 3 and 4 for you, as it borrows a Thread from the ThreadPool, runs it in the background, and terminates by executing its RunWorkerCompleted handler on the main thread.

6.
when multi-threading, things could go terribly wrong when shared data isn't properly synchronized. I can't tell in your case, just assume the main thread sets imgList or imgList.Images to Nothing while your extra thread is running.

Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

GeneralRe: A quick threading question Pin
Alan Burkhart15-Mar-11 4:48
Alan Burkhart15-Mar-11 4:48 
AnswerRe: A quick threading question Pin
Luc Pattyn15-Mar-11 4:53
sitebuilderLuc Pattyn15-Mar-11 4:53 
GeneralRe: A quick threading question Pin
Alan Burkhart15-Mar-11 5:19
Alan Burkhart15-Mar-11 5:19 
AnswerRe: A quick threading question Pin
Luc Pattyn15-Mar-11 5:34
sitebuilderLuc Pattyn15-Mar-11 5:34 
GeneralRe: A quick threading question Pin
Аslam Iqbal15-Mar-11 8:18
professionalАslam Iqbal15-Mar-11 8:18 
QuestionAdo,vb .net datagridview datasource runtime Pin
Member 389234313-Mar-11 23:22
Member 389234313-Mar-11 23:22 
AnswerRe: Ado,vb .net datagridview datasource runtime Pin
Simon_Whale13-Mar-11 23:43
Simon_Whale13-Mar-11 23:43 
GeneralRe: Ado,vb .net datagridview datasource runtime Pin
Dalek Dave14-Mar-11 0:06
professionalDalek Dave14-Mar-11 0:06 
QuestionWriting to debug log Pin
cstrader23213-Mar-11 14:50
cstrader23213-Mar-11 14:50 
AnswerRe: Writing to debug log Pin
Luc Pattyn13-Mar-11 15:04
sitebuilderLuc Pattyn13-Mar-11 15:04 
AnswerRe: Writing to debug log Pin
Bernhard Hiller14-Mar-11 2:26
Bernhard Hiller14-Mar-11 2:26 
QuestionAccess to the registry key is denied. Pin
TornadoApps10-Mar-11 22:24
TornadoApps10-Mar-11 22:24 
AnswerRe: Access to the registry key is denied. Pin
Dalek Dave10-Mar-11 22:40
professionalDalek Dave10-Mar-11 22:40 
GeneralRe: Access to the registry key is denied. Pin
TornadoApps10-Mar-11 22:51
TornadoApps10-Mar-11 22:51 
GeneralRe: Access to the registry key is denied. Pin
riced10-Mar-11 22:57
riced10-Mar-11 22:57 
AnswerRe: Access to the registry key is denied. Pin
Zagarov18-Mar-11 7:22
Zagarov18-Mar-11 7:22 
Questionadding database while building setup file Pin
basheer.j10-Mar-11 9:33
basheer.j10-Mar-11 9:33 

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.