I got this error on a server. (On my PC everything works fine
Unable to cast COM object of type 'System.__ComObject' to interface type 'PDFXCoreAPI.IPXS_Inst'
This operation failed because the QueryInterface call on the COM component for the interface with IID '{9B44A054-D66C-4AC6-90DB-2E23FBB67EF5}' failed due to the following error: Bad variable type. (Exception from HRESULT: 0x80020008 (DISP_E_BADVARTYPE)).
error COM cast
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, 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.
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.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: error COM cast
Hello Tom,
Please provide a code sample so that we can analyze it and advice to your problem.
Cheers,
Alex
Please provide a code sample so that we can analyze it and advice to your problem.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 83
- Joined: Wed Mar 25, 2015 10:15 am
Re: error COM cast
This is the code that generates the error:
if (Initialized == false)
{
MyPXC.Init(lsKey);
//MyPXV.Init(
// MyIPXV = (IPXV_Inst)MyPXC.GetExtension("PXC");
MyIPXS = (IPXS_Inst)MyPXC.GetExtension("PXS");
MyIAUX = (IAUX_Inst)MyPXC.GetExtension("AUX");
Initialized = true;
}
if (Initialized == false)
{
MyPXC.Init(lsKey);
//MyPXV.Init(
// MyIPXV = (IPXV_Inst)MyPXC.GetExtension("PXC");
MyIPXS = (IPXS_Inst)MyPXC.GetExtension("PXS");
MyIAUX = (IAUX_Inst)MyPXC.GetExtension("AUX");
Initialized = true;
}
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: error COM cast
Please read this topic - there was a problem with Windows Server with Editor SDK - maybe it would lead you to solution:
https://forum.pdf-xchange.com/ ... 66&t=26088
Cheers,
Alex
https://forum.pdf-xchange.com/ ... 66&t=26088
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 83
- Joined: Wed Mar 25, 2015 10:15 am
Re: error COM cast
I think I found the problem:
It is not threadsave!
You can only use the PXC.Init function from 1 thread?!
What's the best way to solve this?
It is not threadsave!
You can only use the PXC.Init function from 1 thread?!
What's the best way to solve this?
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: error COM cast
The best thing to do would be provide a small working project sample that we can try and we'll advice you further.
Cheers,
Alex
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
- Lzcat - Tracker Supp
- Site Admin
- Posts: 677
- Joined: Thu Jun 28, 2007 8:42 am
Re: error COM cast
Hi Tom.
You will be surprised, but PXC.Init must be called once when loading DLL (or starting application if it does not call LoadLibrary directly). It is common PDF engine initialization and should be done once until program is closed.Tom Princen wrote:I think I found the problem:
It is not threadsave!
Victor
Tracker Software
Project manager
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software
Project manager
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.