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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Should I use an EXE or DLL?

Status
Not open for further replies.

rube

Programmer
Dec 24, 2000
41
0
0
CA
Hi, all.

I am building an application that uses Photoshop's scripting engine (with VB) to output vast numbers of big images files. Naturally, when the app is stepping through the database to get data for the images and formatting them, it's not accessible to the user. Can't cancel, can't do anything. Just have to wait or kill the process.

I'm guessing that I should make a separate exe - to do the work and leave the main app free to interact with the user - rather than a dll which runs as if it were part of the main program. Is this correct?

If I did use a separate exe, how would I stop it from executing? How do I make it notify the main app of the status of its operations?

Obviously, I'm an amateur, but throw it at me, I can take it! Even just a couple of leads would help.

Thank you.
 

Here is a thought, you could add a progress bar to your app and during your loading you could update its value letting the user know that you are doing work for the user. You might also want to place a doevents or two in your code so it does not look like your application is locked up.

Good Luck

 
Hi,
If the application doesnt require any user interaction, you can use Activex exe. Activex Exe takes its own resources different from the main exe.
If the progarm u executing is server side then u can have to use the Activex DLL.

Thanks
John Philip
 
Thanks guys:

vb5prgrmr: this program can work for a LONG time. i did what you suggest in the first version, but it proved to be inconvenient for the client, so I'm looking for ways to intervene without actually shutting it down.

jshanoo: how would I control the activex exe from the main app? can i halt the activity and perhaps restart it?

is there any danger in simply killing the process that the new exe is running in?
 
Hi Rube,
These are the things we suggest.
Now a programmer has to analyse things, code the program accordingly.
You can refer books, websites for better idea.
Parameters can be passed on to the Actvex exe.
Now if you want check the progress of the exe, u can use a log file or a windows registry.
! REGISTRY !, if not wisely used it will hamper your windows

All the BEST.
Please try to do the home work ffrom your side also.

John Philip
johnphilip@justdial.com
 

Ok, another thought... Place a command button somewhere that when clicked sets a variable that you can check for. You would check for this value being set in places where it is safe for you to exit the process that you are currently doing in a safe manner. This would also allow you to clean up of necessary.

Good Luck

 
Thanks, guys. Sometimes its difficult to know where to start (and what to search for) with these things. I find the MS help pretty vague. When people ask me to build them software, I say yes... then I have to go learn how...
 
just a little addition:
actually creating an activeX EXE is almost the same as creating an activeX DLL, it's only that activeX EXE will run on it's own thread.
beside using registry/log files, you can define an event in the class inside the activeX EXE and raise the event to notify the main program about it's progress.
 
Howdy... here's my 2 cents on this...

Using an activeX exe would be the way to go... when you create your component, you will be defining Events, Properties and Methods to interact with said control.

You should add a Progress Property that you can check using "object.Progress"

If you want to halt the ActiveX component's activity, use a Method such as "object.Cancel".

Simply write your code in the main app to respond to the users wishes, thereby you will have total control and everybody comes out happy!

A word of caution on always saying "Yes"... then learning how. I've been guilty of doint the same thing, and it can often come back to haunt you. I've learned that it looks much better to say "that will be difficult to do, I'll let you know if I can do it". Your customers don't want a "yes man", when you do manage to pull it off and make it work, they see you more as a HERO because you didn't commit and you still produced. If you can't give them exactly what they wanted, you still please them when they get the alternative.

I hope this helps, if not, I might be able to help further.

Tuna

 
Right on, Tuna. Fortunately, I've known this particular client for quite a while (built their website). In other cases I'm a little more cautious, as you say.
 
Oh I hear ya... so the customer doesn't want you to do it right, they want you to do it their way?! :)

So just to make sure we're on the same page here... if the process is taking way too long and they want to cancel it, you need a way for them to just cancel it, right? Do you also need a way to 'pause' the operation and free up the computer for something else?

if you need a pause, just add a property called Pause, make it boolean and switch it to True when a pause is needed.

In your code that is doing the processing, perhaps a do loop (grrrr... i hate loops) that checks while object.pause = false do stuff
so when .pause gets set to true, the loop simply doesn't run... and never omit doEvents inside your loops!

or ad an easy little flag test:

if object.pause = true then exit sub

You with me? Or am I missunderstanding your need here?

Tuna
 
I think you understand my need perfectly. I also think your solution will work perfectly.... that is, when I get the chance to implement it.

I'm using Flash, XML, and Access in the same project. It's going well but I have my hands full. I'm just thankful they have an original version to beat on while I'm working. That one was primitive but they've saved a helluva lot of man-hours using it.

Thank you,
Rob

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top