Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


multithreading in vb

Posted on 2002-07-03
Medium Priority
Last Modified: 2010-05-02
is it possible to do multithreading in vb?
if yes then i want to develop mail server which is able to respond to more than one client at a time?
is that possible?
for example, smtp is listening on 25 and pop3 on 110, if one client is sending a big mail which may take one minute then is smtp / pop3 able to respond to other e-mail clients in that particular one minute

please reply soon
thank you very much
hemali sutaria
Question by:hemalisutaria
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7126605

Expert Comment

ID: 7127113
LVL 18

Accepted Solution

mdougan earned 800 total points
ID: 7132084
Under VB5 it was possible to multi-thread by calling the CreateThread windows API.  However, under VB 6, they changed the threading model of VB so that calls to CreateThread causes your program to crash.

The only way to do this under VB 6 is to call a component that is written in some other multi-threading language, such as C or C++, which will generate/manage the threads.

I've seen some references to OCX controls for doing just this, so, try searching the web for multi-threading OCX.

I believe that Desiware has one, for a start, but theirs might be somewhat expensive.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 49

Expert Comment

ID: 7971412
Hi hemalisutaria,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept mdougan's comment(s) as an answer.

hemalisutaria, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer

Expert Comment

ID: 8019144
I disagree with the recommendation so I will leave this open.  It appears on the surface that the application provided by rpai's link provides multi-threading and it indicates it works in VB6.  This leads me to believe it may be possible and perhaps even angelIIIs code may also work.  Will somebody please give these a shot and let me know one way or the other.  Thanks, it will be very much appreciated.  I'll give this the standard 3 day waiting period.  After which, upon not hearing from anyone, I intend to PAQ without a refund.

Community Support Moderator @Experts Exchange
LVL 49

Expert Comment

ID: 8020998
My $0.02:

From the thread posted by AngelIII:
>> VB6 is much less thread-safe than VB5. The Msgbox function, for example, is notoriously unsafe for threading.

From the thread posted by rpai:
>> Unfortunately there is a reason why this code isn't already posted here on PSC, this is because this code tends to make VB *very* unstable...
In my eyes, that make mdougan's recommendation the best and most complete answer (the others did not mention this apparently well-documented instability at all).  But I'm not an expert, just a day laborer with aspirations.

-- Dan

Expert Comment

ID: 8095769
per initial recommendation

Community Support Moderator @Experts Exchange

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question