Click here to Skip to main content
15,888,610 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionDesktop background Pin
The real $M@30-Jun-09 3:35
The real $M@30-Jun-09 3:35 
AnswerRe: Desktop background Pin
Tom Deketelaere30-Jun-09 4:18
professionalTom Deketelaere30-Jun-09 4:18 
AnswerRe: Desktop background Pin
Sk9330-Jun-09 5:43
Sk9330-Jun-09 5:43 
AnswerRe: Desktop background Pin
chilinhhacker13-Jul-09 19:17
chilinhhacker13-Jul-09 19:17 
GeneralRe: Desktop background Pin
The real $M@14-Jul-09 5:25
The real $M@14-Jul-09 5:25 
Questiontv tuner and directShow Pin
gsipes30-Jun-09 3:30
gsipes30-Jun-09 3:30 
QuestionMultithreading confusion Pin
Sonhospa30-Jun-09 2:59
Sonhospa30-Jun-09 2:59 
AnswerRe: Multithreading confusion Pin
Luc Pattyn30-Jun-09 3:19
sitebuilderLuc Pattyn30-Jun-09 3:19 
Hi,

Threads (all kinds of them, including ThreadPool threads, and BackgroundWorkers) other than the thread that created a Control (BTW: a Form is also a Control), should not access that Control, except for the very few members explicitly allowed, including InvokeRequired and Invoke.

Before .NET 2.0 the app may behave badly, the GUI may freeze, anything can go wrong if you violate the rule.

Since 2.0 you get an InvalidOperationException by default; you can disable that by setting Control.CheckForIllegalCrossThreadCalls false, but that is a very bad idea, and it brings you back in the previous situation.

Since most if not all Controls are somehow related (they are on a Form, one Form owns another Form, etc), the natural consequence is all Controls get created and accessed exclusively by a single thread, typically your initial or main thread, often also called the "GUI thread".

There are lots of examples on InvokeRequired/Invoke available everywhere;
a rather advanced article on the subject is here[^].

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.

QuestionRe: Multithreading confusion Pin
Sonhospa30-Jun-09 10:04
Sonhospa30-Jun-09 10:04 
AnswerRe: Multithreading confusion Pin
Luc Pattyn30-Jun-09 10:24
sitebuilderLuc Pattyn30-Jun-09 10:24 
GeneralRe: Multithreading confusion Pin
Sonhospa1-Jul-09 10:31
Sonhospa1-Jul-09 10:31 
GeneralRe: Multithreading confusion Pin
Luc Pattyn1-Jul-09 11:03
sitebuilderLuc Pattyn1-Jul-09 11:03 
GeneralRe: Multithreading confusion Pin
Sonhospa1-Jul-09 20:20
Sonhospa1-Jul-09 20:20 
QuestionHow to connect DB in Lan Connection? Pin
JC.KaNNaN30-Jun-09 2:25
JC.KaNNaN30-Jun-09 2:25 
AnswerRe: How to connect DB in Lan Connection? Pin
Aman Bhullar30-Jun-09 3:25
Aman Bhullar30-Jun-09 3:25 
GeneralRe: How to connect DB in Lan Connection? Pin
loid grey manuel24-Mar-11 6:20
loid grey manuel24-Mar-11 6:20 
AnswerRe: How to connect DB in Lan Connection? Pin
Dave Kreskowiak30-Jun-09 3:47
mveDave Kreskowiak30-Jun-09 3:47 
QuestionAlgin Left in Excel Export from VB.net Application Pin
maddylein29-Jun-09 21:30
maddylein29-Jun-09 21:30 
AnswerRe: Algin Left in Excel Export from VB.net Application Pin
dan!sh 29-Jun-09 21:48
professional dan!sh 29-Jun-09 21:48 
GeneralRe: Algin Left in Excel Export from VB.net Application Pin
maddylein29-Jun-09 22:21
maddylein29-Jun-09 22:21 
QuestionHow to convert an exe into a service Pin
RK11@200929-Jun-09 19:29
RK11@200929-Jun-09 19:29 
AnswerRe: How to convert an exe into a service Pin
Christian Graus30-Jun-09 0:18
protectorChristian Graus30-Jun-09 0:18 
GeneralRe: How to convert an exe into a service Pin
paas30-Jun-09 2:44
paas30-Jun-09 2:44 
GeneralRe: How to convert an exe into a service Pin
Jon_Boy30-Jun-09 4:15
Jon_Boy30-Jun-09 4:15 
GeneralRe: How to convert an exe into a service Pin
Christian Graus30-Jun-09 10:32
protectorChristian Graus30-Jun-09 10:32 

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.