our company is currently evaluating the PDF-XChange Editor SDK. We would like to use it together with Qt/C++. Unfortunately, we have encoutered some problems:
I have created a demo project with Qt, C# and MFC. Only the C# project works.
1. For the use with Qt C++, I created a header file with wrapper classes from the typelib (PDFXEditCore.x64.tlb). Qt offers a special tool called dumpcpp to do so. The generated header file as is did not work because some structs were missing. I also tried it with a MFC project in Visual Studio, to make sure that the error has not been not caused by dumpcpp . Same there, the header file is not compileable due to missing structs. Thus, I assume that the typelib is incomplete. However, I have looked up the structs from the documentation and fixed the errors in the header files.
2. My project contains a simple GUI with a PDF-XChange Editor ActiveX control and two buttons. Basically, I am trying to call the functions OpenDocFromPath(BSTR) and OpenDocumentFromFile(LPWSTR, IPXC_DocAuthCallback*).
My application raises the following errors:
Code: Select all
QAxBase: Error calling IDispatch member OpenDocFromPath: Type mismatch in
parameter 0
QAxBase: Error calling IDispatch member OpenDocumentFromFile: Member not found
The first error indicates that the parameter being passed to OpenDocFromPath either is not of type BSTR or it does expect a type different from BSTR. The second one is really odd because the OpenDocumentFromFile function is not even found.
We believe the problem is in the control since we are doing what is expected with it reporting as a BSTR, but the control is the one claiming that the parameters do not match so something is not right there.
I tried to compare it to my MFC project but I have got two other problems there:
- On one machine, I have got Visual Studio 2015 installed. I can build and run the program. When I run it, it shows a MessageBox saying, that it could not open the library.
- On another machine, I have got Visual Studio 2017 installed. There I cannot even drag the ActiveX control on the form. When I try to do so, the whole IDE crashes. After that, I copied the Visual Studio 2015 project from the other machine and opened it. Then it shows a message box saying: "Debug Assertion Failed! Program: C:\Windows\SYSTEM32\mfc140ud.dll File: d:\agent\_work\3\s\src\vctools\vc7libs\ship\atlmfc\src\mfc\occont.cpp Line 925".
Regards