PDFXEditCore.x86.dll Error when distributed and run on client

PDF-XChange Editor SDK for Developers

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

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.
jhmas
User
Posts: 4
Joined: Tue Mar 04, 2025 8:07 pm

PDFXEditCore.x86.dll Error when distributed and run on client

Post by jhmas »

I have a console app in .Net 4.8 running fine on a dev computer where the PDFXEditorSDK10.msi is installed, but when I try to run/test it on another computer I'm getting the following errors. What could I be missing here?

PDFXEditCore.x86.dll version is 10.5.1.394
From https://sdkhelp.pdf-xchange.com/view/PXV:Redistribution

> Using the COM-Server Method
Unhandled Exception: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x8219101B
at PDFXEdit.IPXV_Inst.Init(Object pCtx, String pLicKey, Object pUserSettingsSrc, Object pHistorySrc, Object pHistoryThumbsSrc, Int32 nFlags, Object pReserved)
at POC.Program.Main(String[] args) in C:\POC\Program.cs:line 20

> Using the Registration-Free(Click-Once) Method
Unhandled Exception: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'PDFXEdit.PXV_Inst'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{D726366D-34D6-49FC-A341-7B84C54CCA3E}' failed due to the following error: Bad variable type. (Exception from HRESULT: 0x80020008 (DISP_E_BADVARTYPE)).
at POC.Program.Main(String[] args) in C:\POC\Program.cs:line 17

line 17 PXV_Inst _Inst = new PXV_Inst();
line 20 _Inst.Init();
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3586
Joined: Thu Jul 08, 2004 10:36 pm

Re: PDFXEditCore.x86.dll Error when distributed and run on client

Post by Ivan - Tracker Software »

Please place a resources.dat file in the folder where the PDFXEditCore.x86.dll is located. This file is a part of the SDK.
PDF-XChange Co Ltd. (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
jhmas
User
Posts: 4
Joined: Tue Mar 04, 2025 8:07 pm

Re: PDFXEditCore.x86.dll Error when distributed and run on client

Post by jhmas »

Okay, I've re-deployed with the resources.dat file and gives the same error:
c:\POC>dir
Volume in drive C has no label.
Volume Serial Number is 305C-8442

Directory of c:\POC

03/04/2025 07:41 PM <DIR> .
03/04/2025 07:41 PM <DIR> ..
03/04/2025 07:35 PM 11,264 BCDocPDFX.exe
03/04/2025 07:41 PM 416 BCDocPDFX.exe.config
03/04/2025 02:19 PM 1,690 BCDocPDFX.exe.manifest
03/04/2025 07:35 PM 22,016 BCDocPDFX.pdb
01/29/2025 05:32 PM 57,016,656 PDFXEditCore.x86.dll
03/04/2025 02:24 PM 1,349 PDFXEditCore.x86.X.manifest
01/29/2025 04:57 PM 4,398,524 Resources.dat
7 File(s) 61,451,915 bytes
2 Dir(s) 28,598,644,736 bytes free

c:\POC>bcdocpdfx.exe
Hello, World!

Unhandled Exception: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'PDFXEdit.PXV_Inst'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{D726366D-34D6-49FC-A341-7B84C54CCA3E}' failed due to the following error: Bad variable type. (Exception from HRESULT: 0x80020008 (DISP_E_BADVARTYPE)).
at BCDocPDFX.Program.Main(String[] args) in C:\POC\Program.cs:line 17
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3586
Joined: Thu Jul 08, 2004 10:36 pm

Re: PDFXEditCore.x86.dll Error when distributed and run on client

Post by Ivan - Tracker Software »

Can you make a simple app that reproduces the issue, zip it, and send it to us for investigation?
PDF-XChange Co Ltd. (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
jhmas
User
Posts: 4
Joined: Tue Mar 04, 2025 8:07 pm

Re: PDFXEditCore.x86.dll Error when distributed and run on client

Post by jhmas »

POC.zip
Yes. Attached is the app.
You do not have the required permissions to view the files attached to this post.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: PDFXEditCore.x86.dll Error when distributed and run on client

Post by Vasyl - PDF-XChange »

We found reasons why it doesn't work.

1. You need to have all files in one folder together:

image.png

- both manifests, your exe, editor-dll, and editor's Resources.dat file too.


2. You need to specify the app's external manifest in project settings:

image(1).png

3. In manifest for editor-dll you need to change the ThreadingModel from "Appartment" to "Both":

image(2).png

4. In your Main(), at the end, it is better to properly shut down the created and used _Inst object.


Here we attached your project with such fixes:
POC.ZIP
You do not have the required permissions to view the files attached to this post.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
jhmas
User
Posts: 4
Joined: Tue Mar 04, 2025 8:07 pm

Re: PDFXEditCore.x86.dll Error when distributed and run on client

Post by jhmas »

With those changes it is working now. Thank you for the quick assist.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

PDFXEditCore.x86.dll Error when distributed and run on client

Post by Stefan - PDF-XChange »

:)