|
-
Oct 4th, 2000, 10:54 AM
#1
Thread Starter
Addicted Member
Hi,
This is such a simple question, you have permission to attach some hate mail to your reply. I want to call "something" and have it run in the back ground.. IE I have a form, and I want to call a seperate process, so that the process will run in the background and do what it has to do, and the form will continue along its merry way without going waiting for the process to finish.
-
Oct 4th, 2000, 10:57 AM
#2
New Member
One of the easiest ways is to use "Shell" - so long as you have an address for the process. Using various flag options you can run this process minimized and in the background - VB help will tell you the relevant flag settings.
-
Oct 4th, 2000, 11:03 AM
#3
Thread Starter
Addicted Member
But I thought there was a way to use an internal function? Is it a module? I think a module runs in the background, Im just not sure if it needs to finish before the first process can continue..
-
Oct 4th, 2000, 11:12 AM
#4
Thread Starter
Addicted Member
Ok, heres a better way to explain it, I want to be able to call a process inside my vb app, something that is part of that application(Like in that vb6 project), but runs independantly.
-
Oct 4th, 2000, 01:36 PM
#5
I'm not sure what you mean. You want to use the built-in Shell function?
Code:
Shell "C:\prog.exe", vbNormalFocus
DoEvents
'anything below the DoEvents will be processed
'after the application has fully loaded
The Shell function also accepts command lines.
Code:
Shell "Notepad.exe C:\Autoexec.bat", vbNormalFocus
-
Oct 4th, 2000, 02:32 PM
#6
Thread Starter
Addicted Member
What I mean is, say I execute a function in VB, I have to wait for the function to exit before the code that called the function can continue. I want to be able to call a function(Or a slice of code) without stopping my main program.
-
Oct 4th, 2000, 03:54 PM
#7
Hyperactive Member
If you are looping in your function, you could use DoEvents, I believe.
-
Oct 4th, 2000, 06:45 PM
#8
Thread Starter
Addicted Member
Whats doevent, and how does that work? The actual task I wish to accomplish is to have my front end winsock client tell another "thing(This could be ANYTHING, but it has to be lightningly fast, and I would therefore assume part of the same program)" to update an array. Obviously SHELL is to slow for this, and I would hope theres a way of executing a module(Or something like a module) and continuing through your main code, letting the module do its thing in the background(I mean, this IS a multi-tasking environment, right?)..
-
Oct 5th, 2000, 04:58 AM
#9
Thread Starter
Addicted Member
Managed to sort it his AM(GMT), I used a trigger to spot a variable being changed, this then called a module, and they all continued on there merry way... Is this efficient, or is this crap?
-
Oct 5th, 2000, 07:59 AM
#10
Create yourslef an activeX exe that does the processing.
Have a public function in the exe called "ProcessingDone" or something similar, and a sub that starts the processing
Create a reference to the exe using the Withevents keyword
eg:
Code:
Private Withevents mObject as ExeClassName.ProgID
Then all you need to do is call the sub in the exe;
And wait for the event to come back:
Code:
Private Sub mObject_ProcessingDone()
'Do something here now that the
'processign has finished
End Sub
That should work nicely.
- gaffa
-
Oct 5th, 2000, 08:15 AM
#11
Thread Starter
Addicted Member
cheers Gaffa, very usefull, but unfortunately still not fast enough, is my method of using a timer ****? It seems fast, I just dont know if its considered "taboo" or anything.. are timers ok?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|