Anyone using the VPE4.0 DLL with PROGRESS ABL? I NEED HELP!

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Anyone using the VPE4.0 DLL with PROGRESS ABL? I NEED HELP!

Postby BartG » Wed Oct 08, 2008 10:26 pm

I am having a great deal of difficulty getting the DLL to work correcly with Progess (we have Progress 10.1b).

If there is anyone out there using the VPEP3240 DLL with Progress, could you please contact me at bgarlotte@utcretail.com? I need some advice/guidance, whatever to get the DLL to work with my progress Non-Window (appServer) program!!!!!!!

Thanks in advance!

Bart
BartG
 
Posts: 17
Joined: Tue Mar 18, 2008 5:06 pm
Location: Scottsdale,AZ

Postby IDEAL Software Support » Thu Oct 09, 2008 2:06 pm

To clarify things for readers of this forum: Normally one uses the VPE ActiveX component with Progress, so that there are no such problems.

Regarding your problem, I think we have come to the limits of "remote debugging by mail". We do not know Progress, we do not know what your application does in detail, and we do not know your environment.

We do offer you that you send us a small sample application - which makes the problem reproduceable. In this case we can attach with our debugger directly to this application and observe how and when it is calling VPE. This way we can exactly tell you what is going wrong.

We do provide this service at our standard support rates. If you are interested in this option, please contact our technical support by e-mail to discuss the details.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

VPE in Progress ABL Demo procedure enclosed

Postby TimBloom » Fri Dec 19, 2008 2:56 am

In consultation with Bart and many google searches, I realized that the Progress ABL needs to be told to keep the dll persistent so the objects the dll creates remain persistent between method calls. Below is the working demo program. Once we develop a working library of ABL wrappers, it will be far faster to prepare reports and much more portable. No more "WRX" files to recompile, and the reports will be able to generate on an Appserver where no user interface is present.

Here's the demo:
Code: Select all
/* --------------------------------------------------------
*   File: vpe.p -- Demo VPE/dll access in Progress ABL 4GL.
*---------------------------------------------------------*/

/* ******  Definitions  ************************** */

/* Install VPE so the DLL is Registered */
&SCOP dll_file "vpep3240.dll"

/* {vpe.i} */
/* Only including what's used for demo */
&GLOB     VPE_FIXED_MESSAGES 131072
&GLOB     VUNIT_FACTOR_CM 100000
&GLOB     VUNIT_FACTOR_INCH 254000
&GLOB     VUNIT_FACTOR_MM10 1000

DEF VAR rReport      AS CHARACTER     NO-UNDO.
DEF VAR intError     AS INTEGER       INITIAL 0 NO-UNDO.
DEF VAR decLastPosXY AS DECIMAL       NO-UNDO.
DEF VAR decUnit1     AS DECIMAL       NO-UNDO.
DEF VAR decUnit2     AS DECIMAL       NO-UNDO.
DEF VAR decX         AS DECIMAL       NO-UNDO.
DEF VAR decY         AS DECIMAL       NO-UNDO.
DEF VAR decX2        AS DECIMAL       NO-UNDO.
DEF VAR decY2        AS DECIMAL       NO-UNDO.
DEF VAR hRptHdl      AS INTEGER       NO-UNDO.
DEF VAR hDocHdl      AS INT64         NO-UNDO INIT -1.
DEF VAR intFlag      AS INTEGER       NO-UNDO.
DEF VAR hWnd AS INTEGER NO-UNDO. /* OK to keep zero */

/* Constants sometimes need to be decimals, not literals */
DEFINE VAR VPE_FIXED_MESSAGES AS INTEGER  INITIAL {&VPE_FIXED_MESSAGES} NO-UNDO.
DEFINE VAR VUNIT_FACTOR_MM10  AS DECIMAL  INITIAL {&VUNIT_FACTOR_MM10} NO-UNDO.
DEFINE VAR VUNIT_FACTOR_INCH  AS DECIMAL  INITIAL {&VUNIT_FACTOR_INCH} NO-UNDO.


/* ***************************  Main Block  *************************** */

ASSIGN decX  = 1
       decY  = 1
       decx2 = 7
       decY2 = 5
       rReport = "c:\temp\vpeTestRpt.vpe".

MESSAGE "Prior to VpeOpenDocFile" SKIP
        "VPE_FIXED_MESSAGES" {&VPE_FIXED_MESSAGES} VIEW-AS ALERT-BOX.
RUN VpeOpenDocFile (OUTPUT hDocHdl, 0, rReport, "Title", {&VPE_FIXED_MESSAGES}).

/*
MESSAGE "Prior to VpeOpenDoc"
        SKIP "hWnd" hWnd
        SKIP "VPE_FIXED_MESSAGES" {&VPE_FIXED_MESSAGES} VIEW-AS ALERT-BOX.
RUN VpeOpenDoc
   (OUTPUT hDocHdl, hWnd, "Title", {&VPE_FIXED_MESSAGES}).
*/

IF hDocHdl = 0 THEN /* VpeOpenDoc returns a handle */
DO:
   MESSAGE "Document Handle Returned zero."
      SKIP "This is means the OpenDoc method"
      SKIP "encountered an error. Returning."
   VIEW-AS ALERT-BOX.
   RETURN.
END.

/*
MESSAGE "Prior to VpeLicense"
        SKIP "Output hDocHdl: " hDocHdl
        VIEW-AS ALERT-BOX.
RUN VpeLicense (INPUT hDocHdl,
                INPUT "VPE-P2400-xxxx",
                INPUT "xxxx-xxxx").
*/

MESSAGE "Prior to VpeGetLastError"
        SKIP "Output hDocHdl: " hDocHdl
        VIEW-AS ALERT-BOX.
RUN VpeGetLastError (OUTPUT intError, hDocHdl).

MESSAGE "Prior to VpeGetUnitTransformation (1)"
        SKIP "Returned from VpeGetLastError: " intError
        SKIP "hDocHdl: " hDocHdl
        SKIP "VUNIT_FACTOR_INCH" {&VUNIT_FACTOR_INCH}
        SKIP "decUnit1" decUnit1
        SKIP "decUnit2" decUnit2
        VIEW-AS ALERT-BOX.
RUN VpeGetUnitTransformation (OUTPUT decUnit1, INPUT hDocHdl).

MESSAGE "Prior to VpeSetUnitTransformation"
        SKIP "hDocHdl: " hDocHdl
        SKIP "VUNIT_FACTOR_INCH" {&VUNIT_FACTOR_INCH}
       SKIP "decUnit1" decUnit1
        SKIP "decUnit2" decUnit2
        VIEW-AS ALERT-BOX.
RUN VpeSetUnitTransformation (hDocHdl, VUNIT_FACTOR_INCH ).

MESSAGE "Prior to VpeGetUnitTransformation (2)"
        SKIP "hDocHdl: " hDocHdl
        SKIP "VUNIT_FACTOR_INCH" {&VUNIT_FACTOR_INCH}
        SKIP "decUnit1" decUnit1
        SKIP "decUnit2" decUnit2
        VIEW-AS ALERT-BOX.
RUN VpeGetUnitTransformation (OUTPUT decUnit2, INPUT hDocHdl).


MESSAGE "Prior to VpeWrite"
        SKIP "hDocHdl: " hDocHdl
        SKIP "VUNIT_FACTOR_INCH" {&VUNIT_FACTOR_INCH}
        SKIP "decUnit1" decUnit1
        SKIP "decUnit2" decUnit2
        VIEW-AS ALERT-BOX.
RUN VpeWrite (OUTPUT decLastPosXY, hDocHdl, decX, decY, decX2, decY2,
              "Hello World").

MESSAGE "Prior to VpeWriteDoc" VIEW-AS ALERT-BOX.
RUN VpeWriteDoc (OUTPUT intError, hDocHdl, rReport).

/* VpeCloseDoc returns with an intError = 1.
** But the file was generated. */
MESSAGE "Prior to VpeCloseDoc" VIEW-AS ALERT-BOX.
RUN VpeCloseDoc (OUTPUT intError, hDocHdl).
MESSAGE "Procedure Completed"
        SKIP "intError" intError
        SKIP rReport SEARCH(rReport) VIEW-AS ALERT-BOX.

/* Important or Server go boom on go-live :) */
RELEASE EXTERNAL {&dll_file}.

RETURN. /* External API procedure definitions follow */


/* Don't bother with CDECL */

/*Define the VpeOpenDocFile() method*/
PROCEDURE VpeOpenDocFile EXTERNAL {&dll_file} PERSISTENT:
  DEFINE RETURN PARAMETER hDocHdl    AS LONG      NO-UNDO.
  DEFINE INPUT  PARAMETER hWindow    AS LONG      NO-UNDO.
  DEFINE INPUT  PARAMETER pReport    AS CHARACTER NO-UNDO.
  DEFINE INPUT  PARAMETER chrTitle   AS CHARACTER NO-UNDO.
  DEFINE INPUT  PARAMETER LongFlags  AS LONG      NO-UNDO.
END PROCEDURE.

/*Define the VpeOpenDoc() method*/
PROCEDURE VpeOpenDoc EXTERNAL {&dll_file} PERSISTENT:
  DEFINE RETURN PARAMETER hDocHdl    AS LONG      NO-UNDO.
  DEFINE INPUT  PARAMETER hWindow    AS LONG      NO-UNDO.
  DEFINE INPUT  PARAMETER chrTitle   AS CHARACTER NO-UNDO.
  DEFINE INPUT  PARAMETER LongFlags  AS LONG      NO-UNDO.
END PROCEDURE.

/*Define the VpeSetUnitTransformation() method*/
PROCEDURE VpeSetUnitTransformation EXTERNAL {&dll_file}:
  DEFINE INPUT   PARAMETER hReport   AS LONG NO-UNDO.
  DEFINE INPUT   PARAMETER dblFactor AS DOUBLE    NO-UNDO.
END PROCEDURE.

/*Define the VpeGetUnitTransformation() method*/
PROCEDURE VpeGetUnitTransformation EXTERNAL {&dll_file}:
  DEFINE RETURN PARAMETER dblFactor AS DOUBLE    NO-UNDO.
  DEFINE INPUT  PARAMETER hDoc      AS LONG NO-UNDO.
END PROCEDURE.

/*Define the VpeWrite() method*/
PROCEDURE VpeWrite EXTERNAL {&dll_file}:
  DEFINE RETURN PARAMETER intLastPOS AS DOUBLE    NO-UNDO.  /*dec*/
  DEFINE INPUT  PARAMETER hReport    AS LONG NO-UNDO.
  DEFINE INPUT  PARAMETER intPOSX    AS DOUBLE    NO-UNDO.  /*dec*/
  DEFINE INPUT  PARAMETER intPOSY    AS DOUBLE    NO-UNDO.  /*dec*/
  DEFINE INPUT  PARAMETER intPOSX2   AS DOUBLE    NO-UNDO.  /*dec*/
  DEFINE INPUT  PARAMETER intPOSY2   AS DOUBLE    NO-UNDO.  /*dec*/
  DEFINE INPUT  PARAMETER chrTEXT    AS CHARACTER NO-UNDO.
END PROCEDURE.

/*Define the VpeWriteDoc() method*/
PROCEDURE VpeWriteDoc EXTERNAL {&dll_file}:
  DEFINE RETURN PARAMETER intError   AS SHORT NO-UNDO.
  DEFINE INPUT  PARAMETER hReport    AS  LONG NO-UNDO.
  DEFINE INPUT  PARAMETER chrFile    AS CHARACTER NO-UNDO.
END PROCEDURE.

/*Define the VpeCloseDoc() method*/
PROCEDURE VpeCloseDoc EXTERNAL {&dll_file}:
  DEFINE RETURN PARAMETER intError   AS SHORT NO-UNDO.
  DEFINE INPUT  PARAMETER hReport    AS LONG  NO-UNDO.
END PROCEDURE.

/*Define the VpeGetLastError() method*/
PROCEDURE VpeGetLastError EXTERNAL {&dll_file}:
  DEFINE RETURN PARAMETER intError   AS LONG NO-UNDO.
  DEFINE INPUT  PARAMETER hDoc       AS LONG NO-UNDO.
END PROCEDURE.

/*Define the VpeLicense() method*/
PROCEDURE VpeLicense EXTERNAL {&dll_file}:
  DEFINE INPUT  PARAMETER hDoc       AS LONG NO-UNDO.
  DEFINE INPUT  PARAMETER serial1    AS CHARACTER NO-UNDO.
  DEFINE INPUT  PARAMETER serial2    AS CHARACTER NO-UNDO.
END PROCEDURE.


Cheers! -- Tim
TimBloom
 
Posts: 1
Joined: Fri Dec 19, 2008 2:48 am

Postby IDEAL Software Support » Fri Dec 19, 2008 12:12 pm

Thank you for this helpful information!
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 12 guests