Contents of the INMEM.TXT file
INMEMA memory block search routine
11114 Brownstone Dr
Parker, Co. 80134
The INMEM program was written to help BAT files chose the correct
instructions to execute when that decision is dependant on whether a
memory resident program is resident or not. For example, a bat file
to run an application that requires BTRIEVE to be memory resident
might be coded as follows:
if errorlevel 1 goto loadbtrieve
...run the application...
...load btrieve into memory...
...run the application...
...now unload btrieve...
This bat file would load btrieve into memory if its not already
there, run the application, and unload btrieve when the application
programs are done. However, if btrieve is already in memory the bat
file will run the application programs and then exit, leaving btrieve
alone since it was already there.
You can include the resident() function from the inmem program into
your own "C" program. If you need to read your SideKick appointment
file, you can get the directory that SideKick was loaded from by
calling resident(); Resident() returns a far pointer to the fully
qualified path if the resident program was found. If it was not
found a 0 is returned. The drive:path\pgm loaded from string can be
moved into your own string to be parsed with fnsplit() to get the
location of the appointment file. You will get a NULL terminated
asciiz string, so no length calculations or end of data searches will
have to be performed in order to do string functions on it.
I also use the resident() function in programs that are spawn'd from
a root program and cannot run without the root program. In the
initialization portion of the "spawn'd" program I call resident()
with the name of the root program. If a "false" is returned, I
display a message that says "You cannot run this program without
??.exe. Please run ??.exe instead".
Since this kind of stuff is a hobby for me, there are obviously no
warranties of any kind, shape, or form. I will, however, be open to
suggestions on how to improve this code or try to help solve any
problems that you may have with it. I have found it quite useful for
many different applications. Have fun with it.
Note:I have also included a copy of my DMAP program. This is a
memory mapper like many others, except that it shows far more detail
than most. You can inspect individual memory blocks, print reports,
etc. I have not included source code for it because it was written
using Vitamin C screen utilities. If anyone is interested in the
source code, let me know and I will be glad to provide it (except for
the Vitamin C libraries). To use it simply run it. The arrow keys
and PgUp, PgDn keys will scroll the display window. Hit the "I" key
to inspect individual memory blocks. Again the PgUp and PgDn keys
will page through the memory blocks while in "inspect" mode. The "P"
key will print the current report. Home and End will always take you
to the first or last allocated memory block.