by IDEAL Software Support » Thu Apr 17, 2014 9:01 am
Maybe I misunderstood your initial question.
Do you want to know what graphical object (for a specific document) in a preview is clicked, or for what document the e-mail button in the toolbar is clicked?
In the latter case neither VpeGetObjectID nor the event VPE_OBJECTCLICKED are what you are looking for. The event VPE_OBJECTCLICKED is for objects like text, images, barcodes, etc. which are clicked by the user in the preview. This has nothing to do with the toolbar. For the toolbar, other events are sent.
From you code, I assume you are using the VPE ActiveX. For the ActiveX you are working with different instances of the VpeControl class for different documents. So, if you are showing two different documents at the same time, you have two instances of the VpeControl. Say, they are named Doc1 and Doc2.
I don't know the Visual Dataflex programming language. Other languages either provide to event handlers a parameter with the instance of the object which sent the event I.e. the event handler has a signature like OnVpeBeforeMail(VpeControl sender), by testing if sender = Doc1 ... else if sender = Doc2 you can determine which instance sent the event.
Or there are also languages, which bind event handlers directly to an object instance, i.e. one event handler is named Doc1_OnVpeBeforeMail() and the other Doc2_OnVpeBeforeMail(), which are two separate event handler functions.
To find out how this is handled by Visual Dataflex , please contact Starzen (which provides support for VDF with VPE), or Visual Dataflex technical support or a related forum.