Skip to main content.
home | support | download

Back to List Archive

Re: Swish as a DLL

From: Bryan Rickard <bwr(at)>
Date: Wed Sep 30 1998 - 16:56:19 GMT
I also am developing a Windows front end to search local HTML files.  I don't
think it's necessary to make a Swish-E DLL, although it's certainly possible
and may turn out to be the best solution.

I'm simply shelling to the executable file produced by compiling the source
code in at

I had to make some minor changes to the source code to get it to compile with
my Watcom 6.0 compiler.

My front end is developed in Visual Basic, and I'm using the Windows API
function CreateProcess() as described in Microsoft KB article Q129796 to shell
to the swish-e executable.  

The hard part is detecting when swish-e finishes, as the VB code will continue
executing asynchronously unless you tell it to wait.  Most of the KB article
describes how to use other API functions, notably WaitForSingleObject(), to
detect the end of the shelled program's execution.

This all seems to work with Windows 95 but I haven't tested it with NT yet.
Unfortunately I've seen newsgroup postings warning that WaitForSingleObject()
doesn't work reliably under NT.  If this is true, I plan to use my other method
of detecting the end of a shelled program, which is simply to have the shelled
program write something to a file as its very last action, and having the VB
program look for it periodically.  The API function Sleep() enables VB to wait
between looks without taking up too much CPU time.

If all that fails, I'll convert swish-e to a DLL, which is how my existing
search program (which swish-e is planned to replace) is configured.

Let me have any comments on the relative merits of a DLL versus a shelled
executable in this application.  If anyone wants extracts from my code as I've
developed it so far, let me know.  

- Bryan Rickard

Received on Wed Sep 30 10:09:39 1998