NULL Pointer to Info Interface

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
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

NULL Pointer to Info Interface

Post by greg.rusak@mustimuhw.solutions »

Well, I'm going to try this again with some more screen shots and a clear and simple explanation of what we are doing.
We are currently using PowerBuilder 2017 R2 from Appeon Corporation.
We paint the ActiveX OLE Control onto our Window as follows:
1-ole_pdf.png
As you can see from the Object Browser, the OLE Control has class information and Properties exposed.
2-class_information.png
We have the following code for the Clicked event of our button to activate the PDF:
3-code.png
Here is the same code in case the image is hard to read:

Code: Select all

OLEObject lole_Doc
OLEObject lole_CoreDoc
OLEObject lole_info
OLEObject lole_SrcInfo
OLEObject lole_Icab

ole_pdf.Object.OpenDocFromPath( "C:\ProgramData\Mustimuhw\Forms\test_form.pdf", lole_Icab)

lole_Doc = ole_pdf.Object.Doc
IF IsValid(lole_Doc) THEN
	MessageBox("lole_Doc", "Valid")
ELSE
	MessageBox("lole_Doc", 'Not Valid')
END IF

lole_CoreDoc = lole_doc.CoreDoc
IF IsValid(lole_CoreDoc) THEN
	MessageBox("lole_CoreDoc", "Valid")
ELSE
	MessageBox("lole_CoreDoc", 'Not Valid')
END IF

lole_SrcInfo = lole_CoreDoc.SrcInfo
IF IsValid(lole_SrcInfo) THEN
	MessageBox("lole_CoreDoc.SrcInfo", "Valid")
ELSE
	MessageBox("lole_CoreDoc.SrcInfo", "Not Valid")
END IF

lole_Info = lole_coredoc.Info
IF IsValid(lole_info) THEN
	MessageBox("lole_CoreDoc.Info", "Valid")
ELSE
	MessageBox("lole_CoreDoc.Info", "Not Valid")
END IF
Running the sample application, we get a valid handle message box from the call to instantiate InfoSrc as follows:
4-valid.png
But we get a Not Valid message box when we call to instantiate Info as follows:
5-not_valid.png
And as you can see in the PowerBuilder debugger, we get valid OLE handles to all of the objects, EXCEPT for the Info which is NULL.
6-debug.png
Now according to your documentation, the SrcInfo Property has EXACTLY the same Syntax as the Info Property:
https://sdkhelp.pdf-xchange.com/vi ... nt_SrcInfo
https://sdkhelp.pdf-xchange.com/vi ... ument_Info
So why are we NOT able to get a valid handle to the Info Interface when we can for the SrcInfo interface?
This may be something behind the scenes and a limitation with using PowerBuilder, BUT the documentation shows they have the same Syntax and return pointers.
So can you please explain why we get different results?
I hope this is all clear this time. If you need more detail, please advise.

Kindest Regards,

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

Re: NULL Pointer to Info Interface

Post by Sasha - Tracker Dev Team »

Hello Greg,

We have reproduced that issue when you first noted it and we are investigating this, though it's not a trivial problem and we don't see a solution yet.
Meanwhile, you can use that property through the JS via the IPXV_Inst::ExecuteJS method:
https://help.adobe.com/en_US/acrobat/ac ... _8_23_0_20

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

Re: NULL Pointer to Info Interface

Post by greg.rusak@mustimuhw.solutions »

Hello Alex,

I gave you the example of the SrcInfo versus the Info interface as just one simple case.
However, we are experiencing the same issues getting handles to some of your other interfaces.
For example, using the following code example, again we are able to get a valid handle for the pointer to the AcroForm interface, but we get the same NULL pointer when trying to get a handle to the Pages interface, as follows:

Code: Select all

lole_AcroForm = lole_coredoc.AcroForm
IF IsValid(lole_AcroForm) THEN
	MessageBox("lole_AcroForm", "Valid")
ELSE
	MessageBox("lole_AcroForm", 'Not Valid')
END IF

lole_Pages = lole_coredoc.Pages
IF IsValid(lole_pages) THEN
	MessageBox("lole_pages", "Valid")
ELSE
	MessageBox("lole_pages", 'Not Valid')
END IF
Again, as you can see a very simple case where it works for AcroForm, but fails for Pages.
We need to understand why this is happening to make sure we can use 'ALL' of the functionality of your SDK in our PowerBuilder application before making our purchase.

The most important issue for us right now is to get a valid handle to the pointer for the IPXC_Image interface. Like the others that fail and return a null pointer, the following also returns a null pointer:

Code: Select all

lole_Image = lole_coredoc.AddImageFromFile('C:\image.jpg')
IF IsValid(lole_Image ) THEN
	MessageBox("lole_Image ", "Valid")
ELSE
	MessageBox("lole_Image ", 'Not Valid')
END IF
If you have a way of using the ExecuteJS method to load an image file from the file system and place it on a PDF form as a company logo in the top left corner of a page (in place of using the IPXC_Image Interface), that would be appreciated.

Please let me know if this isn't clear or if you need additional details.

Warm Regards,

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

Re: NULL Pointer to Info Interface

Post by Sasha - Tracker Dev Team »

Hello Greg,

This indeed is strange - I've forwarded this to the appropriate developer so he can take a closer look.
Also, if you can, please give the exe file for your sample project that you gave us earlier.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

Re: NULL Pointer to Info Interface

Post by greg.rusak@mustimuhw.solutions »

Hello Alex,

We can put together a small PowerBuilder executable program that will include the .exe and all the runtime files needed to run a PowerBuilder application.

In order to understand what we should demonstate in the .exe, how will this help you?

In other words, what methods would you like demonstrated and would you want some form of GUI output and such?

Please let us know and we'll put something together.

Regards,

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

Re: NULL Pointer to Info Interface

Post by Sasha - Tracker Dev Team »

Hello Greg,

We will connect our debug dll to see the problem in our code.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

Re: NULL Pointer to Info Interface

Post by greg.rusak@mustimuhw.solutions »

Hello Alex,
We've run into yet another issue, this time after creating the executable. We can provide you with an exe that has your OLE Active X control on it, and although the following code snippet returns a valid pointer:

Code: Select all

lole_Inst = ole_pdf.Object.Inst
IF IsValid(lole_Inst) THEN
	MessageBox("lole_Inst", "Valid")
ELSE
	MessageBox("lole_Inst", 'Not Valid')
END IF
we never get a visual presentation of your PDF control and the following code fails:

Code: Select all

ole_pdf.Object.OpenDocFromPath( ls_filename, lole_Icab)
.
Here is what it looks like in the exe:
exe.png
and here is what it looks like at the same point in the code in our PowerBuilder IDE (Notice that the control is visual in this case and not in the exe):
IDE.png
and here is the error we get in the exe only:
error.png
and here is the same spot in the IDE with no error and the PDF is opened:
no_error.png
Do you still want me to send you our exe? If so, what is the best way for me to send it. It is about a 7 MB file since we need to include some PowerBuilder runtime files. Should I just attach the .zip file to a posting in this forum?

Please let me know.

Warm Regards,

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

Re: NULL Pointer to Info Interface

Post by Sasha - Tracker Dev Team »

Hello Greg,

Please mail it to the following address: polaringu@tracker-software.com

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

Re: NULL Pointer to Info Interface

Post by greg.rusak@mustimuhw.solutions »

Thank you Alex,

I have just emailed you our PowerBuilder application.

Please let me know if any problems.

Kind Regards,

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

Re: NULL Pointer to Info Interface

Post by Sasha - Tracker Dev Team »

Hello Greg,

I've forwarded this to the appropriate developer - he'll take a look when he gets to work.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

Re: NULL Pointer to Info Interface

Post by greg.rusak@mustimuhw.solutions »

Hey Alex,

Are there any switches or method calls to have your OLE ActiveX control send error and other related details to a log file while we are running under the PowerBuilder IDE?

Also, let me know if your developer needs anything else from us.

Kind Regards,

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

Re: NULL Pointer to Info Interface

Post by Sasha - Tracker Dev Team »

Hello Greg,

We have recreated the issue on your sample, that you have provided - now we are trying to figure out where the problem is.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

Re: NULL Pointer to Info Interface

Post by greg.rusak@mustimuhw.solutions »

Hello Alex,

So when you say you "have recreated the issue", which issue exactly have you been able to recreate?

Is it you are able to recreate the fact that the OLE ActiveX control does not render on a Window when running as an .exe or were you able to get past that and are able to recreate the fact that we can not get a valid pointer to the Info Interface whereas we can to the SrcInfo Interface? (as well as a number of those other interfaces).

Thanks.

Here's hoping you have a solution for this, we really want to move forward with your product!

Kind Regards,

Greg
User avatar
Roman - Tracker Supp
Site Admin
Posts: 303
Joined: Sun Nov 21, 2004 3:19 pm

Re: NULL Pointer to Info Interface

Post by Roman - Tracker Supp »

Hello Greg,
So when you say you "have recreated the issue", which issue exactly have you been able to recreate?
We meant the NULL pointer issue. Based on our tests this occurs because PowerBuilder COM wrapping runtime does not support IUnknown based interfaces, only IDispatch based interfaces are supported. However some of the interfaces in the Editor SDK are IUnknown based as their functionality exceeds limitations of OLE Automation type system.

Currently we are working on a solution to this issue. We are going to provide client applications which cannot use IUnknown based interfaces with some transparent wrapper that will allow using at least a subset of properties/methods of such interfaces.
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

Re: NULL Pointer to Info Interface

Post by greg.rusak@mustimuhw.solutions »

Wow!, That is excellent news. Does that mean you think you'll be able to provide a patch at some point to return IDispatch Interface pointers? Or is this a non-starter?

Warm regards and best holiday wishes.

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

Re: NULL Pointer to Info Interface

Post by Sasha - Tracker Dev Team »

Hello Greg,

From what I know, we will create a C++ wrapper template that can be used to overload these methods. By transparent, Roman means that the developer can add any method that he requires relatively easy, by using the logic behind already existing methods. A wrapper like that will solve the IUnknown-based interface problems and will allow you to use the needed methods in your language even if the originals are IUnknown-based.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

Re: NULL Pointer to Info Interface

Post by greg.rusak@mustimuhw.solutions »

Hello Alex,

I don't know how much work this means for you or what exactly is involved, but do you have a "general" idea of when a patch would be available to us for testing? Is this a week, month or year sort of effort?

Kind Regards,

Greg
User avatar
Roman - Tracker Supp
Site Admin
Posts: 303
Joined: Sun Nov 21, 2004 3:19 pm

Re: NULL Pointer to Info Interface

Post by Roman - Tracker Supp »

Hello Greg,

As a preliminary estimation, this feature should be finished by the end of January.
But it will require extensive testing to make sure our SDK interfaces remain backward compatible and do not break existing client software, as the feature will affect a lot of the interfaces.
Most probably we will include it in the next major build (329) that we expect to release in a couple of months.
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

Re: NULL Pointer to Info Interface

Post by greg.rusak@mustimuhw.solutions »

Hello Alex,

We're just checking in to see where you got to with this "feature" and if there's a patch available yet and if not, any idea when it will be ready.

Warmest Regards,

Greg
User avatar
Roman - Tracker Supp
Site Admin
Posts: 303
Joined: Sun Nov 21, 2004 3:19 pm

Re: NULL Pointer to Info Interface

Post by Roman - Tracker Supp »

Hello Greg,

We have included this "feature" (or better - workaround) in the upcoming build 330 of the Editor. It will be available in the next few days.
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

Re: NULL Pointer to Info Interface

Post by greg.rusak@mustimuhw.solutions »

Thanks.

Do you have a download link we'll be able to use and do you know if we need to code anything different, or will existing code base work as expected?

Thanks again.

Looking forward to testing.

Regards,

Greg
User avatar
Roman - Tracker Supp
Site Admin
Posts: 303
Joined: Sun Nov 21, 2004 3:19 pm

Re: NULL Pointer to Info Interface

Post by Roman - Tracker Supp »

The build will be available on our official website, as usual.
No, you do not have to change anything, this feature should work transparently.
However the correct work is not guaranteed for all SDK interfaces. Some interfaces are too low level to make them available for late-binding (IDispatch-based) clients.
greg.rusak@mustimuhw.solutions
User
Posts: 31
Joined: Thu Sep 20, 2018 12:45 am

Re: NULL Pointer to Info Interface

Post by greg.rusak@mustimuhw.solutions »

Thank you for that.

Hopefully we won't be needing any of those low-level interfaces, but won't know until we test.

We'll monitor the official website for the 330 build.

Appreciated.

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

Re: NULL Pointer to Info Interface

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply