The Delphi AutoSave Expert

Author: Peter Below, CIS 100113,1101

Ths software is freeware, you can use it on your system and
redistribute it without charge. However, you may not sell it or charge
for its distribution beyond your costs for media, transportation, and
time. I give no warranties as to the proper functioning of this
software (but i use it myself on a daily basis), don't blame me if your
system starts to go into meltdown <g>!

The AutoSave expert was developed to deal with the synchronisation
problems that occur when Delphi is used with an external editor like
CodeWright (TM). Delphi will not automatically save files when you
switch away from it and also not recognize that files have been changed
by an external party when you switch back to it. The expert adds this
functionality and also provides a menu item to save and reload all
files manually.

There are still some problems on NT (probably also on Win95) when
Delphi is used in combination with a 32-bit editor. CodeWright 32, for
example, has an option to automatically save all open files when the
user switches away from the application. However, this saving is done
in a background thread, so Delphi may be activated before the saving
has been completed. Since the date/time stamps of the files have
not been changed yet at that point the automatic reload will not see
any need to become active. A related problem (due to lazy write disk
caching probably) can occur on the Delphi -> CW32 switch. Here CW may
be activated before the files date/time stamps have been updated and
thus fail to see the need to reload the file. Switching buffers in CW
will take care of that.

These problems do not occur if you switch task via the task manager as
an intermediate app. They only happen if you switch vla Alt-Tab or
mouse action.

Installation
------------

The expert is only provided in source code. You need to compile the
source with Delphi 1.0, which results in a DLL. This DLL is installed
into Delphi by adding an entry in the [Experts] section of DELPHI.INI
(in your Windows directory). You need to restart Delphi to make this
entry active. To remove the expert, simply remove the entry in
DELPHI.INI or comment it out by prefixing it with a semicolon. When the
expert is installed you will notice three new entries in Delphi's Help
menu, that should be self-explanatory.

Sample entry in DELPHI.INI:

[Experts]
ExptDemo=F:\DELPHI\BIN\EXPTDEMO.DLL
AutoSave=F:\DELPHI\PROJECTS\EXPERTS\AUTOSAVE.DLL

THIS EXPERT CANNOT BE USED AS IS WITH DELPHI 2.0! The window proc needs
to be adapted to Win32 (change Word -> DWORD), all occurences of
"export" need to be changed to "stdcall". Than it may work, but since
i've not tested it: no warranties!
