event-problem with two IPXV_Control instances

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.
Post Reply
AteBe
User
Posts: 63
Joined: Thu Dec 06, 2018 7:02 am

event-problem with two IPXV_Control instances

Post by AteBe »

We generate two parallel IPXV_Control instances (A and B) with this code

Code: Select all

OleControlSite iControlSite = new OleControlSiteEx (frame, SWT.NONE, "PDFXEdit.PXV_Control.1");
iControlSite.doVerb (OLE.OLEIVERB_SHOW);
iControlSite.doVerb (OLE.OLEIVERB_UIACTIVATE);
IPXV_Control iCtrl = new IPXV_Control (iControlSite.getPointerToUnknown ());
IPXV_Inst iInst = iCtrl.Inst ();
PDFXChangeEventDispatcher iEventDispatcher = new PDFXChangeEventDispatcher (iControlSite, iCtrl);
Then a MouseActionListener (OleListener) is created for each IPXV_Control instance and registered at the iEventDispatcher.

Code: Select all

iMausActionListener.listenTo (new int [] {MouseAction.WM_LBUTTONDOWN, MouseAction.WM_RBUTTONDOWN});
iMausActionListener.registerMouseAction (iMausAction);
PDFXChangeWrapper. registerListener (iMausActionListener, Arrays.asList (new String [] {IPDFXChangeConst.EVENT_MOUSEACTION}));
This way I have two independent MouseActionListeners (one for every IPXV_Control instance).
If I now click with the mouse in IPXV_Control instances A, I also get a click event for IPXV_Control instances B.

According to the Debugger all created controls are independent instances.
The only exception is the peer of the pointers for iCtrl.Inst(). This value is the same for both IPXV_Control instances.

If I understood the answers in the topic viewtopic.php?f=66&t=27346 correctly,
at the moment it is not possible to create several independent sources of the IPXV_Inst-Object.

Can this be the reason for the event-problem and if so, how do I solve the problem?
If not, what can be the reason for the double events?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: event-problem with two IPXV_Control instances

Post by Sasha - Tracker Dev Team »

Hello AteBe,

The IPXV_Inst object will be the same for the controls in the same process thus the events are handled by it's event server. Think of the control as a wrapper class. Physically, there are two IPXV_MainFrames.

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