[AccessD] ShellExecuteA

Jim Lawrence accessd at shaw.ca
Thu Dec 1 18:10:53 CST 2005


Congratulation Jürgen; good to have you back on the list too.

Jim

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jürgen Welz
Sent: December 1, 2005 2:00 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] ShellExecuteA

I'm back working full time for an old employer and have been asked to refine

and add features to an application I built a few years ago in Access97 that 
was subsequently upgraded to a 2000 version and is now running as 2000 in 
Access 2003.

The problem I am currently experiencing has been blamed on the Access 
application.

I have a list box that displays file names (the path is stored hidden) and 
when a user double clicks in the list, the path and file are passed to 
ShellExecute and this has worked reliably and consistently for several 
years.  The listbox interface is useful because the files are pulled from a 
variety of drives and related folders and can be filtered and sorted on 
various attributes not possible in Explorer.  Three weeks ago one of our 
applications (.pee files) was upgraded to a newer version.

Immediately after the upgrade, users reported that .pee files were not 
opening.  The host application (MDI type) would open but my shell wrapper 
reported that the file was not found.  Double clicking the file in the list 
again usually resulted in the file opening.  I reported the problem to the 
software company and modified my wrapper to first find and open the 
executable for .pee files should it be such a file, sleep for 5 seconds and 
then call itelf again with the file.  This appeared to have solved the 
problem ... but...

Not for everyone and inconsistently.  The list interface also has some 
browse buttons that will open explorer displaying a particular drive/folder.

  Double clicking on the files directly in Explorer will quite consistently 
report that the file is not found while the caption of the message and the 
text report the exact file that is highlighted.  The same with right click -

open, though it will generally open after a couple tries.  If it is one of 
those users who is experiencing problems, both the shell interface and the 
explorer view will fail without error in opeining a subsequent file in the 
MDI.  The file simply doesn't open and there is no error even with open is 
selected from the context sensitive menu in explorer.

There is no question that writing the delay loop solved the problem for some

users, but not all users.  Curiously, all our profiles are essentially 
identical based on a clone of our standard user.

I'm not happy with the kludge I've had to write in attempting to mitigate 
the problem and I'm much unhappier about the fact that it seems that 
ShellExecute is not launching files quite as consistently as double clicking

on files in Explorer.

Ciao
J|rgen Welz
Edmonton, Alberta
jwelz at hotmail.com






More information about the AccessD mailing list