Killing an Automation Object - TechRepublic
General discussion
August 14, 2002 at 09:44 AM
talkingwall

Killing an Automation Object

by talkingwall . Updated 23 years, 10 months ago

I need to butt into an automation object’s processing without getting the “Switch To” “Retry” dialog that Windows throws at me.

I inherited a system that uses Adobe Photoshop 6 to analyze images with a special Photoshop plugin,it’s really pretty nifty. I am creating a Photoshop object, and then processing actions on an image by calling the PlayAction method:

appPs.PlayAction (frmAnalyzeImages.ztxtAction(0).Value) ‘Adhesion

ztxtAction(0) is a custom control created by my predecessor.
The action function is called within a loop as the VB6 application works its way through database records that point to each image file’s location.

We want to be able to kill this process.

I moved the logic into a class module and then defined an event. The event is raised at the end of each pass through the loop and looks to see if the “Kill” button has been clicked.

This process works but it often takes several attempts of clicking the “Kill” button and then windows presenting the “Switch To” “Retry” dialog several times before I’m able to successfully kill the analysis process and destroy the Photoshop App object.

What am I doing wrong? I need to know how to interrupt the process so that when the “Kill” button is pressed, I don’t get that Windows dialog.

THanks

Mark

This discussion is locked

All Comments