Crash using C-Front

Hi all, I created a program that synchronises any table (Or combination of tables), containing any fields, with any kind of Outlook item (Contact item, Appointment , Task). So a company can for example edit it’s customers in Navision or Outlook. And have them update eachother automatically. The programm takes into account several Critical errors of which one is a lost connection to the navision database. As soon as i detect a lost connection i deallocate all resources and close connection to the database. As soon as i set the navision Object to nothing with the following tatement Set NO = Nothing The programm crashes with a general protection failure. The only extra thing i came across is when i try to close the connection to the server with the statement NO.DisconnectServer it raises an execption (Which i trap) But in the manual it doesn’t say anything about DisconnectServer raising an exception Does anyone have a tip on how to prevent the crash? Best regards,

I think that then you using cfront in VB, You can’t call constructor or destructor. It couses error. Try rewrite all func. with out calling constructors or destructors. As I know C++ : Don’t use : CFRONT* cf = new CFRONT(); Use: HMODULE cf; cf = ::LoadLibrary(“cfront.dll”); I’m not 100% sure, but in C++ I use this method & everything OK.

Hi db In VB You can normally call the constructor and deconstructor. Only when you loose a connection to the navision database while you activly using it’s tables and then try to call the destructor it crashes. I think it’s some cleanupcode in the cfront.dll that is not properly written. (I don’t hope it is because if it is i am in trouble, i can’t fix it then Navision should. :slight_smile: ) The only thing i can think of is that if you loose the connection to the database while you activly using it’s tables, you shouldn’t destroy the NO object but reuse it for it’s next connection so it can update some data. Or on the other hand cfront.dll could be buggy :slight_smile: Best Regards, Mario van Zeist

Hi, I was talked with another user couple month ago: “Creating/connect/deleting this class cost everytime 68K memory. connectServer/disconnectserver cost 76K memory stopOnAllExceptions = False cost 8K memory OpenCompany/CloseCompany cost 8k memory” Do you have same problems ? In your case try reconnect. Navision will fix this, be sure, in next version :slight_smile: About CF buggs. I noticed data lost then using tcp connection to db. I have installations with tcp & direct fdb opening, Direct opening works more stable, any data lost. Data lost is coused on flushing data to fdb (EWT). Another problem is then you using more than one thread for calling CF some func. not work fine.

to disconnect from navision you have to do: Nav.releaseAllObjects (Is needed, else an error !!) Nav.closeCompany → if connected to a server -----> Nav.disconnectServer → else close database -----> Nav.closeCompany Nav.StopOnAllExceptions = True Nav.HideError = False Set Nav = nothing