Hello,
We are using the ActiveX SDK With Delphi.
If the first command we issue is CloseAllDocuments(0) then we get an access violation.
Any idea ?
Best regards
CloseAllDocuments(0) crash
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: CloseAllDocuments(0) crash
Hi, entropics.
We cannot reproduce this. Can you send to us the simple example with reproducible issue?
Best
Regards.
We cannot reproduce this. Can you send to us the simple example with reproducible issue?
Best
Regards.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 10
- Joined: Wed Jul 02, 2014 7:00 am
Re: CloseAllDocuments(0) crash
Hello,
Here is a very simple program to reproduce it (in Delphi XE6)
Best regards
Here is a very simple program to reproduce it (in Delphi XE6)
Best regards
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 19868
- Joined: Mon Jan 12, 2009 8:07 am
Re: CloseAllDocuments(0) crash
Thanks entropics,
I've passed it to a colleague from the dev team that will take a look.
Regards,
Stefan
I've passed it to a colleague from the dev team that will take a look.
Regards,
Stefan
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: CloseAllDocuments(0) crash
Hi, entropics.
- for more examples look to our Viewer ActiveX Delphi Examples (<X>:\Program Files\Tracker Software\PDF-XChange Viewer SDK\Examples\DelphiExamples)...
HTH
Reason of that: you called the CloseAllDocuments() when no one document is opened. In this case this function returns the error code "HAVE NO DOCUMENTS". Your COM-stub generates exception on that, in standard way. To prevent this exception use:If the first command we issue is CloseAllDocuments(0) then we get an access violation.
Code: Select all
try
CloseAllDocuments(0);
exept
{ on ex : EOleException do
ShowErrorMessage(ex.ErrorCode); }
end;
HTH
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 10
- Joined: Wed Jul 02, 2014 7:00 am
Re: CloseAllDocuments(0) crash
Thank you very much for your answer,
But i'm a little bit suprised that if you call CloseAllDocuments and there is no opened documents, it fails. I would have expected the function to succeed.
Best regards
But i'm a little bit suprised that if you call CloseAllDocuments and there is no opened documents, it fails. I would have expected the function to succeed.
Best regards
-
- Site Admin
- Posts: 19868
- Joined: Mon Jan 12, 2009 8:07 am
Re: CloseAllDocuments(0) crash
Hello entropics,
It does not "fail" - it returns an exception - which was not handled correctly before.
If there are no opened documents - Close All can not "perform" it's operation so that it can exit with a success code and gives you the exception so that you are aware there were no files closed.
Regards,
Stefan
It does not "fail" - it returns an exception - which was not handled correctly before.
If there are no opened documents - Close All can not "perform" it's operation so that it can exit with a success code and gives you the exception so that you are aware there were no files closed.
Regards,
Stefan