PXV_DocCloseFlags in e.document.beforeClose  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

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.
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

PXV_DocCloseFlags in e.document.beforeClose

Post by zarkogajic »

Hi Support,

How do I get the PXV_DocCloseFlags from the e.document.beforeClose event?

When I do IPXV_Document::Close(flags) I also react on the e.document.beforeClose - but pEvent.Param1 and Param2 are both zero (0) never mind what PXV_DocCloseFlags I set.


-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: PXV_DocCloseFlags in e.document.beforeClose

Post by Vasyl-Tracker Dev Team »

No way at the moment to get such flags fro this event. Now you have only this

bool bAllowCancel = pEvent.Param1 != 0;

bAllowCancel - if true then you can prevent closing doc by:

Code: Select all

if (bAllowCancel)
{
    pEvent.Handled = true;
    pEvent.Result = 1; // any non-zero
}
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: PXV_DocCloseFlags in e.document.beforeClose

Post by zarkogajic »

Hi Vasyl,

Ok, thanks.

Any chance to add PXV_DocCloseFlags value to that event (and also allow *not* closing even if pEvent.Param1 == 0)?

Seems that Param1 != 0 when closing using UI (File-Close, or Tab-"Close"), but == 0 when closing using IPXV_Document.Close (NEVER_MIND_WHAT).

-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: PXV_DocCloseFlags in e.document.beforeClose

Post by Vasyl-Tracker Dev Team »

Any chance to add PXV_DocCloseFlags value to that event
In the next build you will be able to get PXV_DocCloseFlags value from pEvent.Param2.
and also allow *not* closing even if pEvent.Param1 == 0
Surry, but no. When app(or one dev) decided to close doc without any interaction with user - it cannot be stopped by other dev.
but pEvent.Param1== 0 when closing using IPXV_Document.Close (NEVER_MIND_WHAT).
Hmm, seems the doc.Close(PXV_DocClose_AllowCancel) sends the pEvent.Param1!= 0. Can you double-check this?
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: PXV_DocCloseFlags in e.document.beforeClose  SOLVED

Post by zarkogajic »

Thanks. Ok. Will check :)

User avatar
Dimitar - Tracker Supp
Site Admin
Posts: 1797
Joined: Mon Jan 15, 2018 9:01 am

PXV_DocCloseFlags in e.document.beforeClose

Post by Dimitar - Tracker Supp »

:)