1. André Monz
  2. PowerBuilder
  3. Wednesday, 23 November 2022 07:28 AM UTC

Hi Community,

we use a third party OLE-Control to sign PDF-Documents, what basically works well.
I have trouble using a particular method of the control, i can't find the correct datatype in Powerscript for the argument searchresult/pstruct .
Every call of olecontrol.object.SearchString(....) ends up in
"Error calling external object function searchstring ...".
The method returns a structure array with the positions of the search string in a PDF Document.
I have sample code from the Author of the Control, but i have no idea, how i can declare the "ref pstruct" part in Powerscript.

Can someone help me with this?


Regards,
André

Edit: 5.12.2022

I have not found a datatype to use the desired method.
But after inspecting die ActiveX-Control with the PB-Objectbrowser i found a undocumented method with less arguments (just the searched string)
which returns the correct datatype (any array) .
But also with the return value of this method
the original method cannot be called.

Strange,but it doesn't matter now.

Thank you for help.

David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Thursday, 24 November 2022 14:34 PM UTC
  2. PowerBuilder
  3. # 1

I wonder if you can try and access the PDF tool is snapdevelop or visual studio and that might allow you to see the datatypes? Also if you cannot map the datatypes then you can develop a c# wrapper for the code and create your oen DLL to import inot PB.

Comment
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Wednesday, 23 November 2022 22:18 PM UTC
  2. PowerBuilder
  3. # 2

Does your third party OLE-Control have any documentation?
Can you contact the creators of the OLE control to see if they can provide you an explanation of the structure?
If we have the structure in any language, we shgould be able to convert that language into PB.

Comment
  1. André Monz
  2. Thursday, 24 November 2022 10:14 AM UTC
The Sample above is from the documentation.

Due to the errormessage i presume a wrong datatype in my arguments.

The for the c# BSTR SearchString and BSTR Fontname i use String in my Skript

The for the c# uint resLen i use uLong.

But how i declare the pstruct-part?

If i understand the c# code correct the argument "ref pstruct" is a memorypointer to a memoryblock with size 256*48.

I have tried blob and byte[] but with no luck, all calls end with the error message "Error calling external object function searchstring".

  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 23 November 2022 15:59 PM UTC
  2. PowerBuilder
  3. # 3

Hi Andre, Premium Support is normally to help troubleshoot error in your own code or configuration mistakes rather than help implement your project.  Project implementation work would generally be our consulting partners.  Let's first see if you can get help from community.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.