Re: PowerCobol
- From: Alain Reymond <arwebmail@xxxxxxxxx>
- Date: Sat, 28 Jan 2006 09:57:03 +0100
ProdCil a écrit :
> I can make thi:
> INVOKE pow-self "Execute" USING "notepad.exe text.txt"
>
> I want to do the same, but calling "text.chm" for help files and
> "text.pdf", for example.
>
> If i do:
> INVOKE pow-self "Execute" USING "AcroRd32.exe text.pdf"
>
> don't work.
>>> How can call a .HLP or .PDF files in Power Cobol
You can call the windows function that opens a file based on the
extension association.
In MF Cobol, it is
call WINAPI ShellExecute using
by value 0 size 4, *> window handle
by reference z"open", *> operation to perform
by reference
z"myfile.pdf", *> document to open
by value 0 size 4, *> parameters (none here)
by reference sw-cwd, *> directory
by value SW-SHOWNORMAL *> show the file when open
returning se-hInstance
end-call
and there must be the equivalent in PowerCobol (it's the windows API).
If Acrobat is installed on the computer, all pdf files should be
associated with that application. When you call the ShellExecute api, it
looks at the file extension at starts the application associated with it.
a myfile.txt will start notepad, etc...
You don't have to worry about where the application is installed...
Regards.
Alain
.
- Follow-Ups:
- Re: PowerCobol
- From: Jeff Campbell
- Re: PowerCobol
- References:
- PowerCobol
- From: ProdCil
- Re: PowerCobol
- From: Frederico Fonseca
- Re: PowerCobol
- From: ProdCil
- PowerCobol
- Prev by Date: Re: cobol code assessment
- Next by Date: Re: cobol code assessment
- Previous by thread: Re: PowerCobol
- Next by thread: Re: PowerCobol
- Index(es):