Using PROGRESS, I am now able to call the DLL method VPEOpenDocFile(), and get back a value in the RETURNS parameter VpeHandle. This handle returns to me as a 32 bit integer and I get a .VPE document created on the disk.
The problem now is that if I try to pass that handle (hDocHdl) to my next method, say VPEWrite(), VPEGetErrorMsg(), VPECloseDoc(), or anything else, all my system does is hang-up and not perform the requested VPE task.
I have to assume that I am not passing the handle I have received back from VPEOpenDocFile() correctly to the VPE function I am calling to work on my document. Like I said, I receive this value back as an integer value (which I should according to the VPE DLL manual).
What is the datatype supposed to be for vpeHandle hDoc when I try to call the VPEWrite() method?
In Progress, I have to call the method as if it were a procedure, I have to define the parameters and then pass them when I make the call:
THis is how I define VPEOpenDocFile():
PROCEDURE VpeOpenDocFile EXTERNAL "c:\windows\system32\vpep3240.dll":
DEFINE INPUT PARAMETER hWindow AS LONG NO-UNDO. /*handle*/
DEFINE INPUT PARAMETER pReport AS CHAR NO-UNDO.
DEFINE INPUT PARAMETER chrTitle AS CHAR INITIAL "" NO-UNDO.
DEFINE INPUT PARAMETER LongFlags AS LONG NO-UNDO.
DEFINE RETURN PARAMETER hDocHdl AS LONG NO-UNDO.
END PROCEDURE.
hDocHdl is the field that will receive the HANDLE to the object.
Here is how I make the call to VpeOpenDocFile():
ASSIGN rReport = "c:\vpeTestRpt.vpe". /* name the document*/
RUN vpeOpenDocFile (0,rReport,"",VPE_FIXED_MESSAGES,Output hDocHdl).
I get the HANDLE value back just fine (hDocHdl).
Now, here is how I define VpeWrite():
PROCEDURE VpeWrite EXTERNAL "c:\windows\system32\vpep3240.dll":
DEFINE INPUT PARAMETER hReport AS LONG NO-UNDO. /*handle */
DEFINE INPUT PARAMETER intPOSX AS LONG NO-UNDO. /*int*/
DEFINE INPUT PARAMETER intPOSY AS LONG NO-UNDO. /*int*/
DEFINE INPUT PARAMETER intPOSX2 AS LONG NO-UNDO. /*int*/
DEFINE INPUT PARAMETER intPOSY2 AS LONG NO-UNDO. /*int*/
DEFINE INPUT PARAMETER chrTEXT AS CHARACTER NO-UNDO.
DEFINE RETURN PARAMETER intLastPOS AS LONG NO-UNDO. /*int*/
END PROCEDURE.
And here is how I call VpeWrite():
RUN vpeWrite (hDocHdl,830,intY,1050,intY + 40,"Hello World", OUTPUT intLastPosXY).
Notice that I used the hDocHdl that I received back from VPEOpenDocFile(). When I do this, nothing happens...my procedure goes out to VPEWrite(), but never returns.
Once again, the main question is, what should my datatype be for hDocHdl when I call VPEWrite()? SHould it be defined as a LONG (integer)? Any other hints or help is appreciated as well!
I have contacted Progress and they have said that as far as they can tell, I have defined all my parameters correctly as far as the types that Progress can work with, etc.
Thanks,
Bart