Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2006

Tip: Looking for answers? Try searching our database.

Asynchronous problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David I - 23 Dec 2006 21:48 GMT
I am trying to shell a program as so

nResult = shell(" mcrypt.exe", 0)

This works fin but then I want to kill its temp file once it is finished. As
we all know Shell is asynchronous so I have this untill the user closes the
program.

while(tasks.exists(""mcrypt.tmp"))
' Delay
wend

Then the kill

Kill("mcrypt.tmp")

Single stepping through this it appears to work perfectly but in realtime
the kill gives me a 'Path/File access error' intermittently which means my
delay is not working properly. It appears to get to the kill after the
program has been removed from the task list but before it has actually
ended. Is there a better way around this?

And does anybody know what exactly is the task ID returned by the shell
command. It does not appear to have anything to do with the tasks.item
method

Many thanks
David I - 23 Dec 2006 23:06 GMT
Oops mucked up

Try

while(tasks.exists("mcrypt"))
' Delay
wend

That should make more sense

> I am trying to shell a program as so
>
[quoted text clipped - 23 lines]
>
> Many thanks
Jonathan West - 24 Dec 2006 01:48 GMT
>I am trying to shell a program as so
>
[quoted text clipped - 13 lines]
>
> Kill("mcrypt.tmp")

Use the ShellAndWait command from here

http://vb.mvps.org/samples/project.asp?id=Shell32

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.