In my attempt to disable the user to select multiple bookmarks - and only have one selected at a time.
I've been using this code (note: I'm actually using Delphi.):
Code: Select all
if (e.nEventID == nIDS[(int)IDS.e_docSelection_changed])
{
IPXV_Document vDoc = (IPXV_Document)e.pFrom;
if ((vDoc.ActiveSel != null) && (vDoc.ActiveSel.ID == pdfCtl.Inst.Str2ID("selection.bookmarks")))
{
IPXV_BookmSelection bmkSel = (IPXV_BookmSelection)vDoc.ActiveSel;
bmkSel.Items.Remove(0, (uint)(-1 + bmkSel.Items.Count));
}
}
In version 352 this worked fine. Version 354 crashes the application - and the crash happens after the code is executed (with some delay).
I'm attaching the sample app code. Please take a look and let me know how to fix....
p.s.
Does not only affect bookmarks selection. The same crash happens if "disable" (same coding) selecting multiple pages (IPXV_PagesSelection).
-žarko