threading in VB6..
-
I am new in Thread and want to use two functions in diff. thread. My functions are- sendData() and sendInfo() How can i start that these two functions call in diff. thread and can run at same time. Plz explain in detail.. Thanks in adv..
VB6 doesn't support threading. There are work arounds to do this, but you better know what you're doing and why. Also, the debugger does not support debugging multithreaded code. Try it and you'll crash the IDE. If you really want to do threading, drop VB6 and pickup VB.NET.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
I am new in Thread and want to use two functions in diff. thread. My functions are- sendData() and sendInfo() How can i start that these two functions call in diff. thread and can run at same time. Plz explain in detail.. Thanks in adv..
As Dave already mentioned, you don't want to call CreateThread from VB6. You can find example-implementations on the internet, but most aren't complete and it seldom a good idea. For an in-depth explanation, check this[^] article. There are some alternatives, like encapsulating your thread in a complete executable. The best option to add multithreading to an existing VB6 application, is by using VB.NET; you can use the InterOp Toolkit[^] to extend your VB6 application with VB.NET specific code. You could create a new form in VB.NET, add as much threading as you like, and load that form from VB6. If it's a new project then you'd best move on to VB.NET.
I are Troll :suss: