all groups > vb.net controls > july 2006 >
You're in the

vb.net controls

group:

Threading .....


Threading ..... Simon Verona
7/17/2006 2:09:21 PM
vb.net controls:
I think I'm doing this wrong :

I have a class with a public shared method such as follows:

public shared sub myFunction
dim frm as new myFrm
dim t as new Threading.Thread(Addressof frm.myShowDialog
t.start
end sub

In the frm - the myShowDialog just does a "me.showdialog".

The idea is that this function will display a form, but then return control
back to the calling routine immediately without waiting for the form to be
closed.

It works, but I've had several reports of the form that is displayed
"crashing" as it is being displayed, with random errors (I've not got a
sample) or the whole application just disappearing (without error).

Can anybody assist, either by confirming or otherwise that what I'm doing is
reasonable, or perhaps letting me know a better way.

Regards
Simon

--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD

Tel: 0870 080 2300
Fax: 0870 735 0011

Re: Threading ..... Simon Verona
7/17/2006 2:34:35 PM
I guess I should correct the typo:

the line :
dim t as new Threading.Thread(Addressof frm.myShowDialog

should of course read :

dim t as new Threading.Thread(Addressof myFrm.myShowDialog)

this was simply a mistake in my email, and doesn't affect what I was trying
to do!

Regards
Simon

--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD

Tel: 0870 080 2300
Fax: 0870 735 0011

[quoted text, click to view]

Re: Threading ..... Simon Verona
7/17/2006 4:01:53 PM
OOPS, apologies, I posted this to the wrong group - I've reposted to the
languages.vb group, though if you feel like answering here thats fine!

Must be the heat!

Regards
Simon

--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD

Tel: 0870 080 2300
Fax: 0870 735 0011

[quoted text, click to view]

AddThis Social Bookmark Button