bool BDEStart ( ) { // ask the operating system to allow up to 68 file handles (this is a // requirement of BDE) int HandlesAvailable = 0; int HandlesWanted = 68; HandlesAvailable = SetHandleCount ( HandlesWanted ); if ( HandlesAvailable < HandlesWanted ) { MessageBox ( NULL, "No 68 handles", "Error n. 001", MB_ICONHAND ); ErrorFlag = true; } else { // initializing the driver DBIEXEC ( DbiInit ( NULL ) ); // enable trace info DBIEXEC ( DbiDebugLayerOptions ( DEBUGON | OUTPUTTOFILE | FLUSHEVERYOP, "TRACE.INF" ) ); // standard database driver (i.e. DBF tables and NDX/MDX indexes) DBIEXEC ( DbiOpenDatabase ( NULL, NULL, dbiREADWRITE, dbiOPENSHARED, NULL, 0, NULL, NULL, hDB ) ); // set a working directory DBIEXEC ( DbiSetDirectory ( hDB, pszMyPath ) ); } // end of function (ErrorFlag is generally set by DBIEXEC) return ( ErrorFlag ); }