Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 29th, 2004, 02:39 PM
Registered User
 
Join Date: Feb 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multithreading Programming in Visual Basic

I want to know how to write Multithreading programme in Visual Basic
I had tried it with ActiveX ExE but i am still not satisfied whether it is right or wrong . plz help me

Vijay123
 
Old March 1st, 2004, 05:25 AM
Authorized User
 
Join Date: May 2003
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Which platform you are using i mean VB 6.0 or VB.NET ? VB 6.0 does not provide the multithreaded functionality of its own. Through win API you can use this feature into VB 6.0. You will have to declare those API into a module then only you can call them.



Deepesh Jain
VB,VBA & .NET Specialist
Wiley Support Team
 
Old March 1st, 2004, 10:52 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Look at this page:

http://msdn.microsoft.com/library/de...pplication.asp
 
Old March 1st, 2004, 02:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Using API to multithread VB is absolutely not safe. You can find tons of code in the internet that can work for a tiny application and will crash for all the others.

You are in the right track. It is possible to run VB code in a separate thread of execution putting that code in a class in an ActiveX exe and creating it with GetObject instead of the New operator.
A great book on the subject is "Developing COM/ActiveX components in VB6" by Daniel Appleman (Sams Press). The first section regarding ActiveX exe is ~400 pages long, and that gives you an idea of how a big subject this is. Playing by the rules it is possible to write great and safe multithread applications even in VB6.

As a final point, are you really sure that you need multiple threads? Usually a timer will do the thrick as well, avoiding the creation of an ActiveX components. And many technologies (like ADO) support asynchronous calls.

Marco
 
Old March 8th, 2004, 01:36 PM
Registered User
 
Join Date: Feb 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Other help in this matter
      i really enjoy multithreading in java
          i want to have this in vb also

Vijay123





Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Graphics Programming Wrox Blox jminatel Visual Basic 2008 Essentials 0 February 29th, 2008 09:23 PM
Visual Basic API Programming ranuji General .NET 1 May 31st, 2005 02:35 AM
beginning visual basic 6 database programming gskarns1 VB Databases Basics 1 September 29th, 2004 10:46 AM
Beginning Visual Basic 6 Database Programming lizardnotebk All Other Wrox Books 1 December 16th, 2003 01:45 PM
Beginning Visual Basic 6 Database Programming mikeceee All Other Wrox Books 0 July 16th, 2003 09:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.