Hi! I developed a program that synchrnonizes n databases and n companies through message queue and runs as a service. however my program crashes from time to time and c++ displays this message: Unhandeled exception in SyncAgent.exe (cfront.dll)0xc0000005: Acess violation. I know that these kind of exceptions occur when you’re trying to initialize a record but haven’t opened the table yet or similar things, but I can’t pinpoint this one, so I don’t know when does it occur, because it’s not alwas at the same place. Does anyone know how to catch such an exception since, the exception handler build in navision that I have overwritten won’t do it. Program won’t even reach that point. thank you in advance Andrej Renko
Try using the ReleaseAllObjects Method that might help → ReleaseAllObjects Method (Online Help For CFRONT) Releases all allocated resources. Category Database Comments This method is used to release all resources that have been allocated, that is: open tables are closed and records are released. The intended use is after an error has occurred, and you want to clean-up before continuing execution. The current database is not closed, neither is an open company. Remember that all resources must be released before calling OpenDatabase and CloseDatabase.
80 % of such errors is bad parameters passing to CFront 18 % errors couses bad sequence of Cfront calls 2 % CFront bugs You can’t overwrite such exception, becouse it raises OS kernel (memory handler). First check your pointers that are you passing to CFront func. If you using multithreading, make sure that you entering to CFront then all another threads exited. CFront craches on multithreading !!! Put a lot of Mutexes and CriticalSections.