Click here to Skip to main content
15,893,487 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionUsing matlab fuction in VB 6 Pin
azhari2428-Mar-14 0:16
azhari2428-Mar-14 0:16 
AnswerRe: Using matlab fuction in VB 6 Pin
Dave Kreskowiak28-Mar-14 4:14
mveDave Kreskowiak28-Mar-14 4:14 
Questionform resources vs project resources Pin
dilkonika27-Mar-14 2:19
dilkonika27-Mar-14 2:19 
AnswerRe: form resources vs project resources Pin
Nicholas Marty27-Mar-14 2:53
professionalNicholas Marty27-Mar-14 2:53 
QuestionSynchronizing raised events to UI thread possible? Pin
Sam Marrocco24-Mar-14 11:40
Sam Marrocco24-Mar-14 11:40 
AnswerRe: Synchronizing raised events to UI thread possible? Pin
Bernhard Hiller24-Mar-14 22:18
Bernhard Hiller24-Mar-14 22:18 
GeneralRe: Synchronizing raised events to UI thread possible? Pin
Sam Marrocco25-Mar-14 7:33
Sam Marrocco25-Mar-14 7:33 
AnswerRe: Synchronizing raised events to UI thread possible? Pin
Eddy Vluggen26-Mar-14 8:24
professionalEddy Vluggen26-Mar-14 8:24 
smarrocco wrote:
Is there something like this that can be done that the raised events are always running in the context of the main form that created the ProcessUtility_Class object in the first place?
You "could" pass a reference of one of the controls of the main-thread to the worker-thread. That way the control "could" do the invoke. You'd do a myForm.Invoke() from the worker-thread.

..and then you'd be tearing your hair out, trying to fix the "object is already disposed" exceptions; your thread will still be executing when the mainthread starts disposing of stuff.

So, I used IlSpy to look at the code from the backgroundworker, and it's using a neat trick;

AsyncOperation.Post[^]
"Invokes a delegate on the thread or context appropriate for the application model."

Will (probably) try it out in the weekend Smile | :)


--edit
There's a how-to here[^].
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]


modified 31-Mar-14 14:22pm.

QuestionQuestions about SMO Pin
dilkonika24-Mar-14 2:57
dilkonika24-Mar-14 2:57 
AnswerRe: Questions about SMO Pin
Chris Quinn24-Mar-14 3:30
Chris Quinn24-Mar-14 3:30 
GeneralRe: Questions about SMO Pin
dilkonika24-Mar-14 4:02
dilkonika24-Mar-14 4:02 
GeneralRe: Questions about SMO Pin
Chris Quinn24-Mar-14 4:05
Chris Quinn24-Mar-14 4:05 
GeneralRe: Questions about SMO Pin
dilkonika24-Mar-14 4:08
dilkonika24-Mar-14 4:08 
GeneralRe: Questions about SMO Pin
Chris Quinn24-Mar-14 4:10
Chris Quinn24-Mar-14 4:10 
GeneralRe: Questions about SMO Pin
Chris Quinn24-Mar-14 4:14
Chris Quinn24-Mar-14 4:14 
GeneralRe: Questions about SMO Pin
Eddy Vluggen24-Mar-14 8:13
professionalEddy Vluggen24-Mar-14 8:13 
QuestionZedgraph YAxis Bit Values with Text Labels Pin
Member 224024223-Mar-14 22:22
Member 224024223-Mar-14 22:22 
QuestionVB.NET aximp.exe not found Pin
CharlesDE23-Mar-14 21:20
CharlesDE23-Mar-14 21:20 
AnswerRe: VB.NET aximp.exe not found Pin
Bernhard Hiller23-Mar-14 22:00
Bernhard Hiller23-Mar-14 22:00 
GeneralRe: VB.NET aximp.exe not found Pin
CharlesDE23-Mar-14 22:32
CharlesDE23-Mar-14 22:32 
QuestionIdentifying process completion Pin
Sam Marrocco23-Mar-14 10:26
Sam Marrocco23-Mar-14 10:26 
AnswerRe: Identifying process completion Pin
Alan N23-Mar-14 11:02
Alan N23-Mar-14 11:02 
GeneralRe: Identifying process completion Pin
Sam Marrocco23-Mar-14 11:23
Sam Marrocco23-Mar-14 11:23 
QuestionRemove connectionstring from app.config Pin
dilkonika22-Mar-14 7:30
dilkonika22-Mar-14 7:30 
GeneralRe: Remove connectionstring from app.config Pin
PIEBALDconsult22-Mar-14 8:18
mvePIEBALDconsult22-Mar-14 8:18 

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.