Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multi threading

Status
Not open for further replies.

TerraSamba

Programmer
Aug 19, 2002
57
NL
Hi,

I want to execute some functions on an other thread than the rest of the hosting class. I want the hosting class to receive an event with the results of the execution when the command has finished running.

Does anyone have some tips for me how to implement multithreading?

Thanx,

Terra
 
Start with the MSDN help library in Visual Studio. Look under activeX components in the index. It has a large amount of help info as well as sample and tutorials. There are a lot of little details to learn, but it really isn't too bad. I also recommend looking at ActiveX control creation, as it is very similar but gives you more of a "graphical" type of feedback as to the results of your code.
 
You'll have to create an ActiveX.DLL to run under MTS/Component Services or an ActiveX EXE. There are other ways to create alternate threads with VB with API calls and call backs but VB6 is inherantly (spelling?) single threaded.
 
Yep, solved it with an activeX exe. Works pretty okay! Thanks for the info.

Got any debug-tips, because the vb ide says: cannot reference the project because it is exe project. So you'll have to reference the exe itself. And you cannot recompile the exe because it is referenced in the project. So while you're debugging, you keep on (de)referencing the whole time.

Terra
 
When debugging, you open the ActiveX EXE project and start it through the VB IDE (run uncompiled). Next open the project that references the ActiveX project. When you look at references, your project should now reference the ActiveX program, but if you look at the bottom of the reference window, you will notice the actual file referenced is ActiveXName.VBP not ActiveXName.EXE as it is when using the compiled version. Now start your main program, and you will get breaks for errors and be able to set your own break points in both the ActiveX project and your main standard EXE project.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top