Solved

multithreading in vb

Posted on 2002-07-03
7
230 Views
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
0
Comment
Question by:hemalisutaria
7 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
0
 
LVL 5

Expert Comment

by:rpai
Comment Utility
0
 
LVL 18

Accepted Solution

by:
mdougan earned 200 total points
Comment Utility
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.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
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
0
 

Expert Comment

by:SpideyMod
Comment Utility
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.

SpideyMod
Community Support Moderator @Experts Exchange
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
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
0
 

Expert Comment

by:SpideyMod
Comment Utility
per initial recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

771 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now