Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27184

VS 2010 Thread Issue's

$
0
0
Hi all,

Could someone maybe shed some light on this weird result im having with the VS2010 express editor.

Here's the situation,

I have a class that has several objects defined and after it is called from the main form it will start a new thread on a sub routine.

Idea of how it looks:
Code:

private A as SomeClassA
private B as SomeClassB
private Program as Thread

Public Sub Start()
 a = new SomeClassA
 b = new SomeClassB

 Program = New Thread(Sub() DoWork())
 Program.Start()                                            <------ Defined classes (A and B) are still ok
end Sub

private sub DoWork()
 While                                                          <------- Defined classes (A and B) are 'nothing'
  ...code...
 End  while
end sub

Now i have two identical projects with this structure,

Project 1:
Both classes are suddenly 'nothing' upon entering the threaded sub routine.

Project 2:
Both classes A and B are still defined upon entering the threaded sub routine.


So my qeustion is, how is a threaded subroutine affecting two defined classes that have nothing todo with that code/part.
Could this be a bug perhaps?

This drives me nuts for days...

Greets Barret

Viewing all articles
Browse latest Browse all 27184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>