Event when activeX control is fully initialized
Posted: Thu Jan 10, 2019 11:43 pm
Hi Tracker team,
I do have a windows forms application (implemented with C#). The main form of the applications contains the AxPDFXEdit.AxPXV_Control. I also implemented some control events which are handled in the OnEvent method:
My problem is that the registered event for "e.app.initialized" is never triggered. I do get the other two events e.g. when a document is opened or the tool is changed by the user.
I also checked all other available events on: https://sdkhelp.pdf-xchange.com/vi ... PXV_Events
The event "e.app.initialized" seems to me to be the right event to wait until the activeX control is fully initialized. Unfortunately, it's not working. Do you guys have an advice?
I'm using build: 7.0.0327.0001
Cheers,
Martin
I do have a windows forms application (implemented with C#). The main form of the applications contains the AxPDFXEdit.AxPXV_Control. I also implemented some control events which are handled in the OnEvent method:
Code: Select all
private readonly Dictionary<int, Action> _viewerEvents = new Dictionary<int, Action>();
private void RegisterPdfEditorEvents()
{
_viewerEvents.Add(pdfCtl.Inst.Str2ID("e.activeDocChanged"), Event_ActiveDocChanged);
_viewerEvents.Add(pdfCtl.Inst.Str2ID("e.document.toolActivated"), Event_ActiveToolChanged);
_viewerEvents.Add(pdfCtl.Inst.Str2ID("e.app.initialized"), () => _isFormCreated = true);
foreach (var viewerEvent in _viewerEvents)
{
pdfCtl.EnableEventListening2(viewerEvent.Key, true);
}
}
private void PdfCtl_OnEvent(object sender, AxPDFXEdit._IPXV_ControlEvents_OnEventEvent e)
{
Debug.WriteLine("pdfCtl.OnEvent: EventID=={0} / EventDisplayName=={1}", e.nEventID, pdfCtl.Inst.ID2Str(e.nEventID));
if (_viewerEvents.TryGetValue(e.nEventID, out var action))
{
action();
}
}
I also checked all other available events on: https://sdkhelp.pdf-xchange.com/vi ... PXV_Events
The event "e.app.initialized" seems to me to be the right event to wait until the activeX control is fully initialized. Unfortunately, it's not working. Do you guys have an advice?
I'm using build: 7.0.0327.0001
Cheers,
Martin