VPE 6.10 and Silverfrost FTN95

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

VPE 6.10 and Silverfrost FTN95

Postby aldavhu221 » Fri Jul 29, 2011 3:08 am

Here is a copy of a post and the solution I also posted to Silverfrost's FTN95 Forum which may be of help to other VPE users

---------------------------------------------------------------------------------------------------------------------------------------------------------------
My Question:

Has anyone experience of using VPE with FTN95?

I can envisage doing it by writing a custom interface of C/C++ routines to match each of the VPE library routines but there must be a simpler way!

The general form taken by VPE routines is:

// Type of VPE Handles
typedef void * VpeHandle;

// Open new document
VpeHandle hdoc = VpeOpenDoc( NULL, "Test", 0 );

// Write text line to document
VpeWriteLine( hdoc, ix, iy, "Some message at specified page coords" );


So the question is: can the VpeHandle hdoc pointer be captured by an initial C_EXTERNAL call from within a FTN95 subroutine in the form

C_EXTERNAL VPEOPEN 'VpeOpenDoc' (REF, OUTSTRING, VAL)

and then text line written with

C_EXTERNAL VPEWRITE 'VpeWriteLine' (REF, VAL, VAL, OUTSTRING)

and, if so, would the REF be a Fortran long integer variable?

---------------------------------------------------------------------------------------------------------------------------------------------------------------
My solution

After a day's trial and error, the following worked:

PROGRAM VPETEST

STDCALL VPEOPENDOC 'VpeOpenDoc' (VAL,INSTRING,VAL) : INTEGER*4
STDCALL VPEWRITEBOX 'VpeWriteBox' (VAL,VAL,VAL,VAL,VAL,INSTRING)
STDCALL VPELINE 'VpeLine' (VAL,VAL,VAL,VAL,VAL)
STDCALL VPEWRITEDOC 'VpeWriteDoc' (VAL,INSTRING)
!
INTEGER*4 HDOC
REAL*8 X1,X2,X3,X4,Y1,Y2,Y3,Y4
DATA X1/1.0D0/,Y1/1.0D0/,X2/5.0D0/,Y2/1.5D0/
DATA X3/1.5D0/,Y3/3.0D0/,X4/5.0D0/,Y4/6.5D0/
!
HDOC = VPEOPENDOC(0,"TEST",0)
CALL VPEWRITEBOX(HDOC,X1,Y1,X2,Y2,"Hello Aldavhu221!")
CALL VPELINE(HDOC,X3,Y3,X4,Y4)
CALL VPEWRITEDOC(HDOC,"Hello_221.pdf")
!
STOP
END

I would be pleased to discuss successes and issues with anyone else combining FTN95 and the Ideal Software Virtual Print Engine which is truly an awesome DLL commercial library, enabling reports to be produced in RTF and PDF formats in the most intrincate detail.
aldavhu221
 
Posts: 4
Joined: Thu Jul 28, 2011 11:25 pm

Re: VPE 6.10 and Silverfrost FTN95

Postby IDEAL Software Support » Fri Jul 29, 2011 10:06 am

Thank you for your information. We would like to note that the VpeHandle data type of the 64-bit version (coming soon) is 8 bytes wide, it is hard coded to 4 bytes in your code.
IDEAL Software Support
 
Posts: 1622
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 68 guests