I'm trying to find a way to pass back events from my thread inside of a MODULE back to the main thread but the following is illegal:
Public Class frmMain
Inherits System.Windows.Forms.Form
Private m_oThread As modMyThread
...
because modMyThread cannot be used as a TYPE. You may be asking, "Why not use a class for your thread code because you could easily use events to pass back info from the class?" Well, in the calling code (the main thread in my case), when I instantiate the class, then call to start the thread like:
private m_ClassMyThread as clsMyThread
clsMyThread.StartMyThread()
The problem is that my main thread will not get back control until StartMyThread has completed and this defeats the whole purpose of my multithreaded model.
So either a) How do I use events to pass back info from a module to the main app, or b) how can a class allow the main app to continue execution while the class is still running code - like a thread in my case?
Thanks
Public Class frmMain
Inherits System.Windows.Forms.Form
Private m_oThread As modMyThread
...
because modMyThread cannot be used as a TYPE. You may be asking, "Why not use a class for your thread code because you could easily use events to pass back info from the class?" Well, in the calling code (the main thread in my case), when I instantiate the class, then call to start the thread like:
private m_ClassMyThread as clsMyThread
clsMyThread.StartMyThread()
The problem is that my main thread will not get back control until StartMyThread has completed and this defeats the whole purpose of my multithreaded model.
So either a) How do I use events to pass back info from a module to the main app, or b) how can a class allow the main app to continue execution while the class is still running code - like a thread in my case?
Thanks