home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c160 / 2.ddi / WINDOWS / WIND.DOC < prev   
Encoding:
Text File  |  1990-10-30  |  4.7 KB  |  107 lines

  1. Code Base 4.2, MicroSoft C 6.0 and Windows 3.0.
  2.  
  3.  
  4.  
  5. Testing :
  6.  
  7.      The testing was done with respect to the file management routines in
  8. Code Base 4.2.  The windowing routines were not tested.
  9.  
  10.      While testing, we worked under both the medium and large memory
  11. models and the different Window modes (real, standard and enhanced).  As
  12. well, experiments were made using the Windows applications: HEAPWALKER 
  13. and SHAKER.  These did not seem to cause any problem with Code Base.
  14.  
  15.  
  16. Hints, Suggestions :
  17.  
  18. 1.   Do not use 'd4init'.  This function will attempt to allocate a 64K
  19.      buffer for use in indexing.  We found that the largest buffer that
  20.      will be allocated will be 32K (this may not be the case in every
  21.      situation, ie. others may be able to allocate more or less than 32K).
  22.      Instead of calling 'd4init', call 'd4initialize' explicitly at the
  23.      beginning of your Code Base section.  The last parameter, 'buf_bytes',
  24.      should not be more than the above specified 32K.
  25.  
  26.      If you are in the large memory model, and want to allocate up to a 64K
  27.      buffer (or call 'd4init'), make the following changes:
  28.  
  29.      h4.c, line 112:    old: char * h4alloc( int num )
  30.                         new: char * h4alloc( unsigned int num )
  31.      h4.c, line 137:    old: char * h4alloc_try( int num )
  32.                         new: char * h4alloc_try( unsigned int num )
  33.      d4all.h, line 164: old: extern char * h4alloc( int num ) ;
  34.                         new: extern char * h4alloc( unsigned int num ) ;
  35.      d4all.h, line 165: old: extern char * h4alloc_try( int num ) ;
  36.                         new: extern char * h4alloc_try( unsigned int num ) ;
  37.  
  38. 2.   Code Base does not use the functions: 'OpenFile' and '_lclose'.
  39.      Code Base uses the traditional C run-time library routines 'open',
  40.      'sopen' and 'close'.
  41.  
  42. 3.   MicroSoft has informed us that we may experience problems with
  43.      using pointers to functions.  Our testing, however, has failed to
  44.      demonstrate that this problem exists within Code Base.  If you
  45.      experience this problem, as a possible solution you will need to 
  46.      exclude the module containing the e4 functions from the M4.LIB, and
  47.      declare it as a separate code segment that is FIXED in memory.  The
  48.      filter routines you identify through 'x4filter' could also have the
  49.      same potential problems.  A similar solution as stated above could
  50.      be implemented.
  51.  
  52. 4.   When Code Base allocates memory for its structures and global variables,
  53.      it declares the memory as fixed.  This prevents the invalidation of
  54.      pointers in Code Base.
  55.  
  56. 5.   The 'm4edit' and 'm3edit' functions in Code Base are not usable.  
  57.      Windows does not define the 'spawnl' function.  If you do need some 
  58.      type of memo edit, you might want to consider using the 'LoadModule' 
  59.      or the 'WinExec' functions in Windows.
  60.  
  61. 6.   You will probably want to write your own 'u4error' routine which uses
  62.      a MessageBox or a DialogBox (or something else), instead of just
  63.      causing a 'FatalExit' (like u4error would normally do under Windows).
  64.      
  65.      Example:
  66.  
  67.      u4error( int error_num, char *msg, ... )
  68.      {
  69.         int  i;
  70.         char str[255];
  71.  
  72.         for ( i=0; i < sizeof(error_data)/sizeof(ERROR_DATA); i++ )
  73.            if ( error_data[i].error_num = error_num )
  74.               break;
  75.  
  76.         if ( error_num )
  77.            sprintf( str, "Error Number :  %d\n\n%s\n%s", error_num,
  78.                                             error_data[i].error_data, msg );
  79.         else
  80.            sprintf( str, "Error Number : %d\n\n%s", error_num, msg );
  81.  
  82.         MessageBox( hWnd, str, NULL, MB_OK | MB_ICONSTOP );
  83.      }
  84.  
  85.  
  86. Batch Files :                                                                
  87.  
  88.      Two batch files are given in the WINDOWS directory.  Here is an 
  89. explanation of what each will produce:
  90.  
  91. m4w_ml.bat  This batch file will produce a Code Base library which will
  92.             work under Windows (w), medium memory model (m) and local
  93.             Code Base allocations (l).
  94.  
  95. m4w_lg.bat  This batch file will produce a Code Base library which will
  96.             work under Windows (w), large memory model (l) and global
  97.             Code Base allocations (g).
  98.  
  99.      The batch files included are examples of batch files which will produce
  100. a Code Base library that can and has been used in Windows.  For ease of
  101. programming and debugging, the optimization is disabled (-Od).  Feel free
  102. to experiment with the optimization switches.  Be sure to use the same
  103. switches for both the compiling of the Code Base library and for your
  104. application.  Note that the options we used are by no means the only ones
  105. you can use.  They were however found to produce a suitable Code Base
  106. library for use in Windows.
  107.