Missing IDispatch Interface

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
martin3
User
Posts: 20
Joined: Tue Oct 11, 2011 6:08 am

Missing IDispatch Interface

Post by martin3 »

Hello,

as PDF XChange Viewer is now discontinued, we actively try to change our application to embed PDF XChange Editor using the SDK. We have an Eclipse based client that uses OLE embedding.While playing with the SDK and trying to build a sample application similar to the one included in the SDK, I had to recognize that several objects returned from the API do not support IDispatch but only IUnknown. As long as they do not support IDispatch, it is impossible to access the objects with Eclipse RCP.

In my attempt to build the sample application I yet stumbled over:
- IAFS_NamesCollection.Item while attempting to work with the ShowOpenFilesDlg
- IPXC_Document.Info while attempting to work with CoreDoc.Props
Although this might not be the most essential parts of the API, it clearly shows, that many of the objects returned cannot be used further with Eclipse SWT. I now stopped to investigate that further, as most of my tests showed exactly the same symptom. I always fail on 80% of my way, due to the missing IDispatch support.

Can you please check this issue. If many of even most of the APIs do not support IDispatch, PDF Xchange Editor will be unusable for us and I would really regret that, because we had great experience with PDF XChange Viewer over several years.

Moreover, Eclipse SWT seems to be unable to access APIs using LPWSTR instead of BSTR. I addressed this issue to the Eclipse community. Again, if there will be no solution for that (e.g. via a utility method that converts between BSTR and LPWSTR), large parts of the API will be unusable.

Thanks
Martin
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Missing IDispatch Interface

Post by Sasha - Tracker Dev Team »

Hello Martin,

Please read this topic:
https://www.pdf-xchange.com/forum3 ... se#p110215

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
martin3
User
Posts: 20
Joined: Tue Oct 11, 2011 6:08 am

Re: Missing IDispatch Interface

Post by martin3 »

Hello Alex,

the post is about ten months old. Are there no news about that topic? By the way if you could provide pure Java interfaces similar to the COM interfaces (or maybe the IDL), than you can create a quite nice and generic solution for calling all interfaces (as long as they implement IDispatch). You could completely hide the COM implementation behind the Java interfaces.

Martin
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Missing IDispatch Interface

Post by Sasha - Tracker Dev Team »

Hello Martin,

Just spoke to the lead dev, and he said that we possibly cannot derive all of the interfaces from the IDispatch - this is very time consuming and has a very big chance that it could break the project.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
martin3
User
Posts: 20
Joined: Tue Oct 11, 2011 6:08 am

Re: Missing IDispatch Interface

Post by martin3 »

Hello Alex,

is there an overview of which objects support IDispatch, in order to check, whether the the most essential functionality we need can be used. We cannot start a trial and error approach.

Thanks
Martin
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Missing IDispatch Interface

Post by Sasha - Tracker Dev Team »

Hello Martin,

You can see this in the tlb files. Though here's the list:

Code: Select all

_IPXV_ControlEvents
===== AFS_ =====
IAFS_AccountData
IAFS_DlgSettingsBtnCallbacks
IAFS_EnumFolder
IAFS_EnumFolderItem
IAFS_FileInfo
IAFS_FileSys
IAFS_Inst
IAFS_NamesCollection


IAUX_Inst
IBitSet
ICab
ICabNode
ICabTemplate
IColor
IDblArray
IEvent
IEventCreator
IEventHandler
IEventServer
IEventsRegistry
IFastScopeTable
IFlag
INumArray
IObjCollection
IOperation
IOperationHistory
IOperationHistoryItem
IOperationList
IOpInputItem
===== PXC_ =====
IPXC_AcroForm
IPXC_AnnotsList
IPXC_DocAuthCallback
IPXC_DocSrcInfo
IPXC_Document
IPXC_FormField
IPXC_Inst
IPXC_PolygonSrcF
IPXC_PolyPolygonSrcF
IPXC_QuadsF
IPXC_Rects
IPXC_RectsF
===== PXS_ =====
IPXS_Inst
===== PXV_ =====
IPXV_AnnotHandler
IPXV_AnnotSelection
IPXV_AnnotsEvent
IPXV_AnnotsList
IPXV_AppSettingsEvent
IPXV_AttachList
IPXV_AttachmentsView
IPXV_AttachSelection
IPXV_BeforePrintEvent
IPXV_BeforeShowContextMenuEvent
IPXV_BookmarksView
IPXV_BookmEvent
IPXV_BookmList
IPXV_BookmSelection
IPXV_CommentStylesChangedEvent
IPXV_CommentsView
IPXV_ContentItemsSelection
IPXV_ContentsView
IPXV_Control
IPXV_DocActionEvent
IPXV_DocCollection
IPXV_DocCollectionNav
IPXV_DocContentsChangedEvent
IPXV_DocContentsChangesInfo
IPXV_DocHighlighter
IPXV_DocHighlightItem
IPXV_DocHighlightItems
IPXV_DocList
IPXV_DocSaveEvent
IPXV_DocSelection
IPXV_Document
IPXV_DocumentView
IPXV_DocumentViewsArea
IPXV_DocViewsList
IPXV_EnumViewsCallback
IPXV_FormFieldsEvent
IPXV_FormFieldsList
IPXV_GotoActionEvent
IPXV_GuideSelection
IPXV_Inst
IPXV_InvalidatePagesEvent
IPXV_JSCodeSnippet
IPXV_JSCodeSnippetsStorage
IPXV_JSValue
IPXV_LayersView
IPXV_LoupeView
IPXV_MainFrame
IPXV_MainView
IPXV_OCOrderElementsList
IPXV_OCSelection
IPXV_OpenFilesDlgRes
IPXV_PageIndexesList
IPXV_PageRectSelection
IPXV_PageRegion
IPXV_PageSizeCtl
IPXV_PagesLayoutChangedEvent
IPXV_PagesPreviewCtl
IPXV_PagesRegions
IPXV_PagesSelection
IPXV_PagesView
IPXV_PagesVisibilityChangedEvent
IPXV_PageThumbnailsView
IPXV_PanZoomView
IPXV_PDFNamedDestsSelection
IPXV_PDFNamedDestsView
IPXV_RangeCtl
IPXV_SaveFileDlgRes
IPXV_SearchView
IPXV_SignaturesView
IPXV_TextSelection
IPXV_Tool
IPXV_UIEvent
IPXV_UILanguages
IPXV_View
IPXV_ViewCreator
IPXV_ViewPanesCollection
IPXV_XFATreeView
IRangeHelper
IScopeTable
IString
===== UIX_ =====
IUIX_Button
IUIX_CharFormat
IUIX_Cmd
IUIX_CmdBar
IUIX_CmdCollection
IUIX_CmdColorBtn
IUIX_CmdItem
IUIX_CmdItemBox
IUIX_CmdLine
IUIX_CmdManager
IUIX_CmdMenu
IUIX_CmdPane
IUIX_CmdRibbonTab
IUIX_CmdRibbonTabs
IUIX_ColorPicker
IUIX_Combo
IUIX_ComboButton
IUIX_ContextHelpHandler
IUIX_ControlsLock
IUIX_Dialog
IUIX_Edit
IUIX_Event
IUIX_Frame
IUIX_Group
IUIX_IndexNavigator
IUIX_IndProgress
IUIX_InfoBtn
IUIX_Inst
IUIX_Label
IUIX_Layout
IUIX_LayoutItem
IUIX_List
IUIX_MouseCaptureMonitor
IUIX_Obj
IUIX_ObjCollection
IUIX_ObjImpl
IUIX_OriginSelector
IUIX_ParaFormat
IUIX_Picture
IUIX_PolygonSrc
IUIX_PolyPolygonSrc
IUIX_Progress
IUIX_PropList
IUIX_PropSheets
IUIX_RangesNavigator
IUIX_RenderContext
IUIX_RibbonFrameWindow
IUIX_Ruler
IUIX_ScrollBar
IUIX_ScrollContainer
IUIX_Slider
IUIX_Spin
IUIX_TabStopFormat
IUIX_TextTabStops
IUIX_Theme
IUIX_ThreadContext
IUIX_ToggleBtn
IUIX_Tooltip
IUIX_Tree
IUIX_TreeItem


IUniqueStrings
IWords
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
martin3
User
Posts: 20
Joined: Tue Oct 11, 2011 6:08 am

Re: Missing IDispatch Interface

Post by martin3 »

Hello Alex,

I am sorry to tell, that some of the interfaces we would need are in the list of interfaces not supporting IDispatch.

How can we continue with this issue? I also tried to work with IUnknown. But unfortunately Eclipse does not support a generic way to access the interfaces and methods a can retrieve.

Did I understand the posts you cited above correctly that you plan to provide a Java based interface? What about the progress of this API? Are there any release plans?

As far as I know PDF-XChange Editor as the successor of PDF-XChange Viewer is the only tool of this quality that allows to view and edit PDF and also offers a COM interface. Therefore I am extremely interested in getting a working solution.

Martin
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Missing IDispatch Interface

Post by Sasha - Tracker Dev Team »

Hello Martin,
I am sorry to tell, that some of the interfaces we would need are in the list of interfaces not supporting IDispatch.
How can we continue with this issue? I also tried to work with IUnknown. But unfortunately Eclipse does not support a generic way to access the interfaces and methods a can retrieve.
There is a way of doing this - you can make a wrapper for example on C++ that would create you a IDispatch based interface with all of the IUnknown interfaces used there in methods. Should work for all of those interfaces.
Did I understand the posts you cited above correctly that you plan to provide a Java based interface? What about the progress of this API? Are there any release plans?
I'm afraid, that:
Just spoke to the lead dev, and he said that we possibly cannot derive all of the interfaces from the IDispatch - this is very time consuming and has a very big chance that it could break the project.
So basically I can't give you any time estimates.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
martin3
User
Posts: 20
Joined: Tue Oct 11, 2011 6:08 am

Re: Missing IDispatch Interface

Post by martin3 »

Hello Alex,

in the meantime we have found a nice solution for our problem that we want to share. We use the Java Library JNA to access your API. Works quite nice, but you need simple wrapper classes to access your API using JNA. We tested this solution with different Java versions in 32bit as well as 64bit and are currently working to replace PDF-XChange Viewer with PDF-XChange Editor in our applications.

I attach a simple Demo that shows how we access the API. It is restricted to the interface "IPXV_Control", but can easily extended to all other interfaces and structures, so that you can access the whole API as fluent as in C#, C++, etc. As some IPXV_Control methods refer to other interfaces, I skipped these methods in this demo, but you can see in one example how it works to return interfaces.

We generated wrapper classes using your TLB file. This works for most interfaces, but not for all parts of your API (e.g. I was not able to access information about records/structs). So - if your company is interested to support a Java API for SWT, it might be better to generate the wrapper classes out of your code or the original IDL.

Martin
Attachments
PDFXChangeDemo.zip
Simple demo application, how to access PDF-XChange Editor SDK using Eclipse SWT and JNA
(7.49 KiB) Downloaded 69 times
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Missing IDispatch Interface

Post by Sasha - Tracker Dev Team »

Hello Martin,

Thanks we will look into this.

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