Trying to update to newer VPE

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Trying to update to newer VPE

Postby craigkrum » Thu Feb 11, 2016 5:19 am

I have an old program that is doing external function calls to the .dll version of VPE 3.1. I recently purchased VPE 7.0, and would like to update the program to work with that version. For some reason, the program is crashing when I attempt to do a VpeWrite call. The syntax seems to be identical, but there may be something I am missing in my conversion. The simplest example to demo the problem is the following button:

Code: Select all
  Object oTest is a Button
    Set Label    to "Test VPE"
    Set Location to 265 20
    Set Size     to 15 30
    Procedure OnClick
        Integer iRetVal
        DWord hDoc
        Move (VpeOpenDoc(0,'Preview',0)) to hDoc
        Move (VpeWrite(hDoc,50,50,150,150,'Hello World')) to iRetVal
        Move (VpePreviewDoc(hDoc,0,VPE_SHOW_MAXIMIZED)) to iRetVal
    End_Procedure
  End_Object


When using the .dll for 3.1, this works with no problem. When I switch to 7.0 the program crashes when it executes the call to VpeWrite. If I comment that line out, 7.0 will create the document, and bring up a blank page to preview, as expected.

I tried this with 4.0 as well, and it crashes at the same place.

Is there something else I need to do when using a newer version than 3.1?
craigkrum
 
Posts: 5
Joined: Thu Feb 11, 2016 4:47 am

Re: Trying to update to newer VPE

Postby craigkrum » Thu Feb 11, 2016 6:59 am

I forgot to mention that I had also tried both of the following VPE commands:

Move (VpeSetUnitTransformation(hDoc,1000)) to iRetVal
and
Move (VpeSetEngineRenderMode(hDoc,0)) to iRetVal

To see if it was a compatibility issue. I also tried various combinations of DWord, Integer, and Handle types for the different parameters, including the document handle. It seems like most every other command works fine, just not commands that actually do output to the page.
craigkrum
 
Posts: 5
Joined: Thu Feb 11, 2016 4:47 am

Re: Trying to update to newer VPE

Postby IDEAL Software Support » Thu Feb 11, 2016 9:41 am

After providing a stable API from v1.x to v3.x for a period of 10 years, we cleaned-up the API in v4.0. All incompatible API changes in the transition from v3.x to v4.0 are documented in the file 'Release Notes', which is installed with VPE. Search for "Compatibility Issues for Users of VPE v3.x" in this file.

Since v4.0 there are no incompatible API changes.

Your crash is likely related to the change of data types, especially all coordinates are now of type double (floating point). They were integer before.
IDEAL Software Support
 
Posts: 1631
Joined: Thu Nov 18, 2004 4:03 pm

Re: Trying to update to newer VPE

Postby craigkrum » Sat Feb 13, 2016 1:27 am

It was indeed the data types. The program that was making the DLL call does not know how to send 'Double' data types, only Integers (VERY old program). I ended up splitting my values across two integer variables, representing the two 'halves' of the double, and sending both of them in place of the Double. Worked perfect!

Thanks for your help.
craigkrum
 
Posts: 5
Joined: Thu Feb 11, 2016 4:47 am


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 1 guest