home *** CD-ROM | disk | FTP | other *** search
- Code Base 4.2, MicroSoft C 6.0 and Windows 3.0.
-
-
-
- Testing :
-
- The testing was done with respect to the file management routines in
- Code Base 4.2. The windowing routines were not tested.
-
- While testing, we worked under both the medium and large memory
- models and the different Window modes (real, standard and enhanced). As
- well, experiments were made using the Windows applications: HEAPWALKER
- and SHAKER. These did not seem to cause any problem with Code Base.
-
-
- Hints, Suggestions :
-
- 1. Do not use 'd4init'. This function will attempt to allocate a 64K
- buffer for use in indexing. We found that the largest buffer that
- will be allocated will be 32K (this may not be the case in every
- situation, ie. others may be able to allocate more or less than 32K).
- Instead of calling 'd4init', call 'd4initialize' explicitly at the
- beginning of your Code Base section. The last parameter, 'buf_bytes',
- should not be more than the above specified 32K.
-
- If you are in the large memory model, and want to allocate up to a 64K
- buffer (or call 'd4init'), make the following changes:
-
- h4.c, line 112: old: char * h4alloc( int num )
- new: char * h4alloc( unsigned int num )
- h4.c, line 137: old: char * h4alloc_try( int num )
- new: char * h4alloc_try( unsigned int num )
- d4all.h, line 164: old: extern char * h4alloc( int num ) ;
- new: extern char * h4alloc( unsigned int num ) ;
- d4all.h, line 165: old: extern char * h4alloc_try( int num ) ;
- new: extern char * h4alloc_try( unsigned int num ) ;
-
- 2. Code Base does not use the functions: 'OpenFile' and '_lclose'.
- Code Base uses the traditional C run-time library routines 'open',
- 'sopen' and 'close'.
-
- 3. MicroSoft has informed us that we may experience problems with
- using pointers to functions. Our testing, however, has failed to
- demonstrate that this problem exists within Code Base. If you
- experience this problem, as a possible solution you will need to
- exclude the module containing the e4 functions from the M4.LIB, and
- declare it as a separate code segment that is FIXED in memory. The
- filter routines you identify through 'x4filter' could also have the
- same potential problems. A similar solution as stated above could
- be implemented.
-
- 4. When Code Base allocates memory for its structures and global variables,
- it declares the memory as fixed. This prevents the invalidation of
- pointers in Code Base.
-
- 5. The 'm4edit' and 'm3edit' functions in Code Base are not usable.
- Windows does not define the 'spawnl' function. If you do need some
- type of memo edit, you might want to consider using the 'LoadModule'
- or the 'WinExec' functions in Windows.
-
- 6. You will probably want to write your own 'u4error' routine which uses
- a MessageBox or a DialogBox (or something else), instead of just
- causing a 'FatalExit' (like u4error would normally do under Windows).
-
- Example:
-
- u4error( int error_num, char *msg, ... )
- {
- int i;
- char str[255];
-
- for ( i=0; i < sizeof(error_data)/sizeof(ERROR_DATA); i++ )
- if ( error_data[i].error_num = error_num )
- break;
-
- if ( error_num )
- sprintf( str, "Error Number : %d\n\n%s\n%s", error_num,
- error_data[i].error_data, msg );
- else
- sprintf( str, "Error Number : %d\n\n%s", error_num, msg );
-
- MessageBox( hWnd, str, NULL, MB_OK | MB_ICONSTOP );
- }
-
-
- Batch Files :
-
- Two batch files are given in the WINDOWS directory. Here is an
- explanation of what each will produce:
-
- m4w_ml.bat This batch file will produce a Code Base library which will
- work under Windows (w), medium memory model (m) and local
- Code Base allocations (l).
-
- m4w_lg.bat This batch file will produce a Code Base library which will
- work under Windows (w), large memory model (l) and global
- Code Base allocations (g).
-
- The batch files included are examples of batch files which will produce
- a Code Base library that can and has been used in Windows. For ease of
- programming and debugging, the optimization is disabled (-Od). Feel free
- to experiment with the optimization switches. Be sure to use the same
- switches for both the compiling of the Code Base library and for your
- application. Note that the options we used are by no means the only ones
- you can use. They were however found to produce a suitable Code Base
- library for use in Windows.
-