Here is a workaround to true multithreading using ActiveX exes and a timer:
Multi-Threaded VB Using ActiveX EXEs
http://www.vbaccelerator.c
Main Topics
Browse All TopicsI am aware that Visual Basic does not support multithreading, but in my vb 6.0 application, can I shell out a seperate exe to handle some seperate code that will run outside the app? That way if numerous instances of that exe are launced, it won't effect perfomance within my vb application. I'm new to threading so let me know if this makes sense.. Thanks in advance..
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Here is a workaround to true multithreading using ActiveX exes and a timer:
Multi-Threaded VB Using ActiveX EXEs
http://www.vbaccelerator.c
I have an application that authenticates users before entering the program. During authentication, I query the domain controller to verify that they have a valid account. If they have a valid account on the DC, but are not in my Visual Basic application, I then use some API's to load that user's profile on that machine. The loading of the user's profile is expensive, and there are numeorus places throughout the application where user's can instantiate this process. The exe's simply load the user's profile, and do not need to communicate with anything. In fact, once they execute, I don't even need to know when or if they finished.. Therefore, I figured simply shelling them out, and managing them in the task manager would suffice..
Make sense?
Passing Parameter Code:
--------------------------
>>>>>>>>
Sub Form_Load()
'check if something was passed on the commandline
if COMMAND$ <> "" then
'if a /F is found then the user passed a filename
if instr(COMMAND$,"/F") then
'Parse the filename out and save it
sFilename = Mid$(COMMAND$,instr(COMMAN
end if
else
msgbox "You must pass a filename as /Ffilename.ext"
end if
end sub
To pass the filename to a seperate program, just shell out like this
lResult = shell("OTHER.EXE /F" + sFilename)
cool12399..
I would like to do that, but not using a filename.. For example.. I know i need to pass 3 parameters.. username password and initials..
Would like to do something like this..
Sub Form_Load()
If COMMAND$ <> "" then
UserName = <Parse COMMAND$ to get username>
Password = <Parse COMMAND$ to get password>
Initials = <Pars COMMAND$ to get initials>
To pass this ..
lResult = shell("C:\MyApp.exe" + UserName + Password + Initials
//Would this work? Is the syntac correct?
Thanks again
You can pass multiple parameters separated with a space or any other control character like "/" or "-"
The use the Split function on the command to split our the 3 parameters:
vntParams = Split(Command, " ") 'split using space
sUser = vntParams(0)
sPass = vntParams(1)
'etc ...
Shell it like this, inserting spaces:
lResult = shell("C:\MyApp.exe" & " " & UserName & " " & Password & " " & Initials)
If the user entered 3 parameters (e.g. in 3 Textboxes or 3 Inputboxes)
you can use the parameters to start a 3rd VB.exe using shell:
**************************
Shell "C:\MyApp.exe" _
& " " _
& UserName _
& " " _
& Password _
& " " _
& Initials, vbNormalFocus
**************************
In the started VB.exe you can use 'Split()'
to get the 3 parameters 'back':
Private Sub Form_Load()
AutoRedraw = -1: FontSize = 24: Dim myArray
myParms = Split(Command, " ") ' the Command Variable contains 3 parameters
'when a VB app starts
Print myParms(0) 'contains 'username'
Print myParms(1) 'contains 'password'
Print myParms(2) 'contains 'initials'
End Sub
Business Accounts
Answer for Membership
by: Idle_MindPosted on 2005-02-09 at 08:03:17ID: 13265394
It really depends on what you are doing...
The question that must be asked is do the seperate EXEs then need to communicate with each other somehow?
Explain in more detail what you are trying to accomplish and we can give you more options.