Fixing Rescan Problems

Date: 28 January 1997
Author: Christopher Kohlhoff

Overview

For all its good points, when ClassExpert breaks it breaks well. The Rescan process (right click your target node in the project window and select Special|Rescan from the popup menu) is used to rebuild a corrupt AppExpert database. For various reasons, Rescan may fail with no more than the message "Rescan Failed"! This article discusses some ways of repairing this, as well as some preventative measures.

Generating a Log File

Although undocumented in the help files (as far as I know), there is an option that causes Rescan to generate a log file. This file is caused AXCGEN.ERR and is placed in the same directory as your project. To set this option create a file called EXPERT.INI in your Windows directory and add the entry:

 [CGenOptions]
 Dump=1

Silent Failure

There are times when rescan will fail without generating an error log. The cause I know of presently is when the sentry in the header (used to prevent multiple includes) does not match the name of the file. That is, if the file is called MYCLASS.H the sentry in the header file must be (for Borland C++ 5.0)

#if !defined(myclass_h)
#define myclass_h

and for Borland C++ 4.5 it must be

#if !defined(__myclass_h)
#define __myclass_h

or the rescan will fail silently.

Fixing Rescan

The things to check when trying to fix a failed rescan are:

Preventative Measures

Basically the preventative measures amount to do not delete or modify the comments of the form //{{ ... }} as these are used by ClassExpert as markers in the code. If you do have to modify them (such as when renaming a class) make sure that you change all occurrences of the old class name.

Further Information

For a more in-depth discussion of the rescan process, check out Borland's technical paper.