ActiveX BSTR type

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Paul - Tracker Supp, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

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
michipapa
User
Posts: 41
Joined: Tue Dec 08, 2009 10:44 pm

ActiveX BSTR type

Post by michipapa » Sun Nov 11, 2018 1:59 pm

Hi,

I try to implement the pdfxchange editor in our project. I use Windev as language (http://www.windev.com)
I have some problems with the BSTR type, because windev only knows strings or unicode strings.
How can I call this :

HRESULT OpenDocFromPath([in] BSTR sSrcPath,
[in, defaultvalue(NULL)] ICab* pOpenParams);

I try something:

MyPath is unicode string="d:\test.pdf"

AX_Pdf>>OpenDocFromPath(&MyPath)

but I get the Error "Parameter1 is wrong format". How could I create a BSTR if my language doesn´t have a type for that ?

Perhaps any windev developer has something made before and could share his knowledge ?

regards Michael

michipapa
User
Posts: 41
Joined: Tue Dec 08, 2009 10:44 pm

Re: ActiveX BSTR type

Post by michipapa » Sun Nov 11, 2018 8:41 pm

Ok,

after some test with other functions (witch are working without any special convertation to BSTR) I think its perhaps a bug in the opendocfrompath function ?

regards Michael

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

Re: ActiveX BSTR type

Post by Sasha - Tracker Dev Team » Mon Nov 12, 2018 7:51 am

Hello Michael,

Try passing NULL as a second parameter of the OpenDocFromPath and see whether this helps.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

michipapa
User
Posts: 41
Joined: Tue Dec 08, 2009 10:44 pm

Re: ActiveX BSTR type

Post by michipapa » Mon Nov 12, 2018 8:22 am

Hi Alex,

I did it before I posted this.

With NULL as second parameter I get "Wrong Parameter 2".

I try this before:

1. AX_Pdf>>CreateNewBlankDoc2("A3",2,90) //works

2. AX_Pdf>>OpenDocWithDlg("C:\Windows") //works

3. AX_Pdf>>OpenDocFromPath("D:\test.pdf") //Error


1. + 2. have also BSTR input definitions and they work how expected.

What is different in (3) ? I tried also with a variable, same.

regards Michael

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

Re: ActiveX BSTR type

Post by Sasha - Tracker Dev Team » Mon Nov 12, 2018 9:51 am

Hello Michael,

Maybe you need to escape the slash character in path?

Code: Select all

"D:\\test.pdf"
Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

michipapa
User
Posts: 41
Joined: Tue Dec 08, 2009 10:44 pm

Re: ActiveX BSTR type

Post by michipapa » Mon Nov 12, 2018 1:39 pm

Hi,

no change, still error. In (2) the path works without "\\"

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

Re: ActiveX BSTR type

Post by Sasha - Tracker Dev Team » Mon Nov 12, 2018 3:27 pm

Hello Michael,

And that document does physically exist on disk by that path and is correctly being opened by the Editor?

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

michipapa
User
Posts: 41
Joined: Tue Dec 08, 2009 10:44 pm

Re: ActiveX BSTR type

Post by michipapa » Mon Nov 12, 2018 3:36 pm

Yes.

Is there any debug or logfile mechanism included, perhaps with a hidden key or function ?

regards MIchael

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

Re: ActiveX BSTR type

Post by Sasha - Tracker Dev Team » Tue Nov 13, 2018 7:19 am

Hello Michael,

The strange thing is that passing the NULL as the second parameter validates the first one and tells that the second is invalid. Let's try creating the OpenDocumentParameters and passing them as the second parameter. For that use this method:
https://sdkhelp.tracker-software.com/vi ... nDocParams

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply