Saving Document Crashing Application  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
jthomas
User
Posts: 31
Joined: Tue Oct 18, 2016 2:49 pm

Saving Document Crashing Application

Post by jthomas »

Hi Tracker,

I have the PDF editor embedded into the application being developed. The user is actively adding and removing annotations to the PDF.

When the user requests opening a new file, the old file is saved. This save is causing my application to crash. Do you have insight into why the save method is failing?

Code: Select all

try
{
    PdfCtrl.OnEvent -= PdfCtrl_OnEvent;
    PdfCtrl.Doc.Save(); // Apllication crashes here, exception not caught
    PdfCtrl.Doc.Close();
}
catch (Exception inner)
{
    string errMsg = string.Format("Failed to close file [{0}].", base.Filename);
    logger.Error(errMsg, inner);
}
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Saving Document Crashing Application

Post by Sasha - PDF-XChange »

Hello jthomas,

Can you please provide a sample project on this matter that we can debug and reproduce the problem?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
prime clinical systems
User
Posts: 211
Joined: Sun Aug 05, 2012 5:20 pm

Re: Saving Document Crashing Application

Post by prime clinical systems »

I'm betting the same fix I'm waiting for
https://www.pdf-xchange.com/forum3 ... 66&t=28884
thanks
ce
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Saving Document Crashing Application

Post by Sasha - PDF-XChange »

Hello Clifford,

From what I see, it's an entirely different issue.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
prime clinical systems
User
Posts: 211
Joined: Sun Aug 05, 2012 5:20 pm

Re: Saving Document Crashing Application

Post by prime clinical systems »

Well exact thing happens, just that I specified it happens on the second time the save is executed. does not trap error and crashes. EVERY TIME very annoying to have to keep reloading the project.
ce
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Saving Document Crashing Application

Post by Sasha - PDF-XChange »

From this code sample alone, we can't possibly know what the overall code that he has in his project. If there is a problem with multiple Instances reinitialization - that's one thing, if there is a problem somewhere in the logic - that's entirely different story. That's why I asked him to give me a sample project.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jthomas
User
Posts: 31
Joined: Tue Oct 18, 2016 2:49 pm

Re: Saving Document Crashing Application  SOLVED

Post by jthomas »

Hi Alex,

The problem was around initializing IPXV instances. I originally was trying to keep 2 instances, 1 on the UI and 1 on the background before I stumbled across a thread stating the same instance is used globally for Tracker's SDK. The exception was caused by finalizing the background instance and then trying to save a page on the UI instance. The background instance no longer shutdowns, it relies on the UI to shutdown its instance.

Thanks,

Jared
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Saving Document Crashing Application

Post by Sasha - PDF-XChange »

Hello Jared,

If the problem is solved then we'll mark this topic as closed.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ