Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple processing with VB

Status
Not open for further replies.

SilentWings

Programmer
Apr 24, 2002
27
PT
Hi ppl,

I have an VB Application in which I want to lunch a window to do some work while the user continue working in other windows.

How can I do that?

Thanks...
 
I assume you want to launch a window ;) VB does not (easily) support multi-threading, so if your other window is doing any work you will need to liberally spread DoEvents statements throughout the code.
 

>Carefully...

Oh! my! :)

An option would be to create a seperate program that you launch via shell or ShellExecute(Ex) or you could create an activex to do the work.

By the way SilentWings, have you read FAQ222-2244 yet?

Good Luck

 
Let me add to strongm's post:

very carefully.

Chip H.

PS. And neither of us are kidding -- it's a very delicate procedure that should not be attempted by someone who gets frustrated easily, or is not a totally disciplined coder. One little mistake and you get random visits by Dr. Watson.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
I agree that using separate EXEs might be best.

They can be coupled where needed in several ways:

A common Jet database.
TCP or UDP sockets.
Named pipes.
MSMQ local machine queues.
An out-of-process COM/DCOM server (ActiveX EXE).

The hardy explorer might also try the seemingly great idea of using a random file open by both programs. I don't recommend this myself.

My own preference would be MSMQ. There are VB-friendly ActiveX components that support this, and they can even be installed into older Windows OSs (even Win95) via the NT 4.0 Option Pack. Using MSMQ machine queues is not much more work than using the Winsock control, and doesn't require Active Directory or a Windows Server.


The ActiveX EXE approach might even provide the place to implement your "background" functionality. I.e. be your "second VB program."

 
I've found with the Active-X EXE approach, you still need to use a timer, even though you have the start mode of the project set to "Standalone".

You call into your public method, start a 1 second timer, and leave. In the background, the timer is still running, and when it fires your program begins.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 

SilentWings, have you read FAQ222-2244 yet? Did any of this help?

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top