PRODUCT : C++ NUMBER : 1764 VERSION : 3.1 & up OS : DOS DATE : January 11, 1994 PAGE : 1/2 TITLE : VROOM Overlay swapping using XMS and EMS In tracking down problems with using Expanded or Extended memory swapping with VROOM overlays, there are a number of factors that can determine whether EMS/XMS memory will be available. These factors include the memory manager(s) being used by the system, the switches passed to these memory managers, the total memory available, other programs using EMS/XMS, etc. Having a simple test program can sometimes prove valuable in tracking down such problems. The following program provides one way to do this, and relies on the simple fact that the overlay swapping functions return zero if EMS/XMS are available. To compile and link these two files from the command line, use "bcc -ml -Y vroom1.c -Yo vroom2.c" /* * vroom1.c * a program for testing _OvrInitEms and _OvrInitExt * compile and link with vroom2.c as described above. */ #include #include /* function to be overlaid */ extern void stub(void); int main() { if (_OvrInitEms(0, 0, 0) == 0) printf("\nOvrInitEMS returned zero. Expanded memory found.\n"); if (_OvrInitExt(0, 0) == 0) printf("OvrInitEXT returned zero. Extended memory found.\n"); stub(); return 0; } /* vroom2.c * a stub so we'll have something to overlay */ PRODUCT : C++ NUMBER : 1764 VERSION : 3.1 & up OS : DOS DATE : January 11, 1994 PAGE : 2/2 TITLE : VROOM Overlay swapping using XMS and EMS void stub(void) { } DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.