ActiveX BSTR type

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

ActiveX BSTR type

Post by michipapa »

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 »

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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: ActiveX BSTR type

Post by Sasha - Tracker Dev Team »

Hello Michael,

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

Cheers,
Alex
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 »

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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: ActiveX BSTR type

Post by Sasha - Tracker Dev Team »

Hello Michael,

Maybe you need to escape the slash character in path?

Code: Select all

"D:\\test.pdf"
Cheers,
Alex
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 »

Hi,

no change, still error. In (2) the path works without "\\"
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: ActiveX BSTR type

Post by Sasha - Tracker Dev Team »

Hello Michael,

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

Cheers,
Alex
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 »

Yes.

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

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

Re: ActiveX BSTR type

Post by Sasha - Tracker Dev Team »

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.pdf-xchange.com/vi ... nDocParams

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