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

Application added to windows task list but not running

Status
Not open for further replies.

RobNorthcott

Programmer
Feb 11, 2002
30
GB
Occasionally my Delphi 5/BDE app fails to run. It adds itself to the Windows task list, but does not appear on the screen and just hangs. Trying to run it again just adds another instance to the task list. One thing that makes this happen is Java updates - if you let the updates run (or turn them off), any instances of my app in the list will carry on running.

Recently it's happened to a customer and we can't work out what's causing it - turned off pretty much everything running on his machine and it's still stuck there in the task list.

Does anybody have any idea what could make an app sit in the task list when launched but never get any further (until some other process is stopped)?

Rob
 
You mentioned your D5 app uses the BDE. I have to assume Paradox tables. Where are the tables located? Local machine, on a server or on another shared client PC?

Paradox can use PDOXUSRS.LCK and PARADOX.LCK files, typically located with the opened tables. It also uses PDOXUSRS.NET, not necessarily located in the same folder as the data; depends on your settings in BDE Administrator, under Configuration>Drivers>Native>PARODOX:NET DIR

Any of these files can become corrupted by abnormal program termination or abnormal PC shut-down. I don't have details but have managed to overcome these issues by deleting them after a clean boot. I'd make a backup of them FIRST, just to be safe. They will be recreated the next time the db is accessed. I doubt other process are the cause, yet understand them not helping either...

HTH

Roo
Delphi Rules!
 
Thanks for the reply. I'm pretty sure it's not a problem with corrupt .net or .lck files, because our app will carry on running as soon as another (not always the same - often Java updates or something) process is closed. In my experience, dead .lck files will raise an error when trying to connect to data files.

We're setting the BDE net path (and private dir) programatically, not using the defaults from the BDE setup. The problem seems to happen equally often on stand-alone machines and ones looking at a network path.

Thanks for the suggestion anyway.

Rob
 
Hey, you're welcome. I did a lot with D5/BDE and those were my only issues. I'd be interested in knowing your solution once you get it resolved. Best of luck in the New Year!

Roo
Delphi Rules!
 
Right, I've got closer to finding out what's going on. The problem happened on my development machine yesterday so I was able to trace the line of code that's hanging.

Pretty much the first thing my app does is checks for other instances of itself on the machine (to stop people running more than one at once and confusing themselves). This uses EnumWindows to call a function for each existing window and looking at the application ID. The function hangs on the line
Code:
iAppID := SendMessage(Handle, UM_APP_ID_CHECK, 0, 0)
on certain apps until the other app is closed - it looks like it's waiting for a reply that never comes back. It would be better if it could be made to time out if no reply was given, but I can't find out how.

Any ideas?

Rob
 
You are indeed my daddy :)
How could I have missed that? I feel a bit of a fool now!
Working perfectly though - should keep a few people happy.
Thanks again,

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top