I am trying to create a procedure in Progress that does not have a window and that uses methods from vpep3240.dll to create a report. This procedure will run on an appServer and we have found we cannot use the OCX to create the reports when running like this.
I have created the Progress procedures and seem to be able to call VpeOpenDocFile(), but I do not seem to get a handle back from it to identify the document. Here is a sample of how the Proc is created in Progress:
PROCEDURE VpeOpenDocFile EXTERNAL "c:\windows\system32\vpep3240.dll":
DEFINE INPUT PARAMETER hWindow AS CHARACTER INITIAL ? NO-UNDO. /*handle*/
DEFINE INPUT PARAMETER pReport AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER chrTitle AS CHARACTER INITIAL "" NO-UNDO.
DEFINE INPUT PARAMETER LongFlags AS LONG NO-UNDO.
DEFINE RETURN PARAMETER hReport AS MEMPTR NO-UNDO. /*handle*/
END PROCEDURE.
Here is how it is implemented in the actual procedure:
RUN vpeOpenDocFile ("",rReport,"",0,Output MemptrVar).
The Value for "rReport" which is the document name is:
"c:\vpeReport.VPE".
I think I am getting a NULL value back as the handle for the Document Handle.
Then, When I try to write to the file using the VpeWrite(), my procedure simply hangs and does nothing.
Again, I assume that this is because I do not have a valid handle. Here is how I make the call:
RUN vpeWrite (MemptrVar,830,intY,1050,intY + 40,"Tender Cd ", OUTPUT intLastPosXY).
I get an object created on the root called "c:\vpeReport.VPE", however if I try to view it, I get this message:
Error Opening File!
Possible Reasons:
-Incompatible Document Version
-Access Denied
-File is not a VPE Document File
-File Damaged
My code never gets to the point where I can actually execute the VpeWriteDoc() and I am assuming it's because it was never created properly and written to.
I tried to put a VpeGetLastError() in after the VpeOpenDoc(), but Progress tells me that it cannot find the entry point to the DLL. Again, I assume this is because my Handle to the Document is invalid.
Am I passing in my parameters correctly to the VpeOpenDoc() method?
I pass a NULL for the Window (Parm1) , since I am not using a window and have no preview.
I pass in "C:\vpeReport.vpe" as the document I want to create.
I pass in blanks for the window title (parm 3).
I pass in a 0 for the Long Flags Parm (parm 4).
I should receive back a memory pointer with the handle, but nothing returns.
I have not yet set up a Message Call Back vpeSetMsgCallback to try to capture the error message, because I am not sure how to perform that function in Progress just yet, but I am trying to do that to capture the error message.
I know you guys aren't particularly familiar with Progress, but I mainly would like to know if I am passing in the parameters to VpeOpenDocFile incorrectly or not? I think I am doing something wrong there which would keep the Doc Handle from being created.
Can you help with that?
Thanks! - bart