Mike Clark
Member
Hi,
We look at PDF files through Progress using the code below and it has been acceptable for a while.
However when a PDF is already being looked at, chosen from a directory, not through Progress, and the code is run (through a program) then the following message is shown and the required PDF is not displayed.
ADOBE READER ERROR
There was an error opening this document. This file cannot be found.
The Hinstance displays 42 in both scenarios.
Any thoughts as this is starting to cause problems with one user who wants lots of .PDFs to be displayed.
Mike
PROCEDURE ShellExecuteA EXTERNAL "shell32":
DEFINE INPUT PARAMETER HWND AS LONG.
DEFINE INPUT PARAMETER lpOperation AS CHAR.
DEFINE INPUT PARAMETER lpFile AS CHAR.
DEFINE INPUT PARAMETER lpParameters AS CHAR.
DEFINE INPUT PARAMETER lpDirectory AS CHAR.
DEFINE INPUT PARAMETER nShowCmd AS LONG.
DEFINE RETURN PARAMETER hInstance AS LONG.
END PROCEDURE.
def var newfilename as char format "x(30)" no-undo.
assign newfilename = "print\25444680.pdf".
Def var OK as logical NO-UNDO.
def var Filename as char NO-UNDO.
def var hInstance as INT no-undo.
FILE-INFO:File-NAME = ".". /* Current directory */
run ShellExecuteA
(0,
"open",
"AcroRd32.exe",
newfileName,
FILE-INFO:FULL-PATHNAME,
/* starting directory */
1,
output hInstance).
message "have hInstance " hInstance skip
view-as alert-box.
We look at PDF files through Progress using the code below and it has been acceptable for a while.
However when a PDF is already being looked at, chosen from a directory, not through Progress, and the code is run (through a program) then the following message is shown and the required PDF is not displayed.
ADOBE READER ERROR
There was an error opening this document. This file cannot be found.
The Hinstance displays 42 in both scenarios.
Any thoughts as this is starting to cause problems with one user who wants lots of .PDFs to be displayed.
Mike
PROCEDURE ShellExecuteA EXTERNAL "shell32":
DEFINE INPUT PARAMETER HWND AS LONG.
DEFINE INPUT PARAMETER lpOperation AS CHAR.
DEFINE INPUT PARAMETER lpFile AS CHAR.
DEFINE INPUT PARAMETER lpParameters AS CHAR.
DEFINE INPUT PARAMETER lpDirectory AS CHAR.
DEFINE INPUT PARAMETER nShowCmd AS LONG.
DEFINE RETURN PARAMETER hInstance AS LONG.
END PROCEDURE.
def var newfilename as char format "x(30)" no-undo.
assign newfilename = "print\25444680.pdf".
Def var OK as logical NO-UNDO.
def var Filename as char NO-UNDO.
def var hInstance as INT no-undo.
FILE-INFO:File-NAME = ".". /* Current directory */
run ShellExecuteA
(0,
"open",
"AcroRd32.exe",
newfileName,
FILE-INFO:FULL-PATHNAME,
/* starting directory */
1,
output hInstance).
message "have hInstance " hInstance skip
view-as alert-box.