I have a weird problem: The first time I run my hack, it detects no records
in its database and creates one. That works fine. However, if I try to
configure my hack (click on the '+' icond) before it has run for the first
time, it crashes. The InitDatabase procedure that i call is the same for
both the hack patch code and the form event handler code. The specific line
that crashes when called from the form event handler on a FrmLoadForm is in
function Boolean InitDatabase(DmOpenRef prevAppHackDB):
hrecord = DmNewRecord( prevAppHackDB, (UInt*)PREVAPP_RECORD_LOC,
DB_PREVAPP_RECORD_SIZE );
The POSE error is " "HackMaster" has just read directly from memory location
zero (NULL). "
this call is preceeded by:
if( ((error = DmCreateDatabase(0, "PrevAppHackDB", 'JVV-', 'prev',
false)) != dmErrAlreadyExists ) && (error != 0) )
{
FrmAlert(ControlPanelErrorAlert);
FrmGotoForm(9000);
return(true);
}
// open the database
prevAppHackDB = DmOpenDatabaseByTypeCreator('prev', 'JVV-',
dmModeReadWrite);
// if there are no records, this is the first run, so initialize the
database.
numRecords = DmNumRecords(prevAppHackDB);
if( numRecords == 0 )
{
if( InitDatabase( prevAppHackDB ) == false )
{
DmCloseDatabase(prevAppHackDB);
FrmAlert(ControlPanelErrorAlert);
FrmGotoForm(9000);
return(true);
Thanks for any suggestions.
-Jacob
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/