Jump to content

Dllcall compatibility problem


eltorro
 Share

Recommended Posts

I have been working on adding the Haru pdf library to AutoIT and I have had some success. But now I am stuck. I converted the slideshow demo included with the library source code to AutoIt3 but it does not produce the pdf file because of an internal error. I converted the same c source to FreeBASIC, using the same dll and it works fine. The function that is failing is _HPDF_Page_CreateLinkAnnot(). It triggers a "destination invalid" error when called from AutoIt. I have tried changing the parameter type to ptr, to handle, to hwnd, to dword with no effect. I compiled both versions as console apps, re-compiled the dll with debugging enabled, and ran both the AutoIt3 and FreeBASIC versions console output redirected to files. Comparing the files, everything looks the same until line 2684. In the FreeBASIC version, this value is the same as line 2646 where in AutoIt it is different. Something else I noticed is that the value returned at this line from the AutoIt version is also different between the compiled exe and when running from SciTE.

The script does not crash, it just fails to produce output consistent with the FreeBASIC version or C.

Internally, _HPDF_Page_CreateLinkAnnot() is calling HPDF_Destination_Validate(). If I explicitly call this function, $dst validates true. It also validates when called internally from _HPDF_Destination_SetFit().

I was using AutoIt 3.3.4 but I just updated to 3.3.6.1 with the same result.

Here are the files.

edit:Added some more information.

Added autoit version info.

Edited by eltorro
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...