Discussion:
Passing a file
(too old to reply)
Mike Glazer
2010-10-01 11:45:05 UTC
Permalink
I am writing a program that at some stage runs a plotting application using
ShellExecut, that takes as its input a datafile. At the moment I create this
datafile as an internediate file. How can I pass the data to the
application without physically saving an intermediate file and then having
to pass its location to the application?
Mike
ap
2010-10-01 13:52:43 UTC
Permalink
Post by Mike Glazer
How can I pass the data to the
application without physically saving an intermediate file and then having
to pass its location to the application?
If the external application does not offer any way to do that, then it
may be quite difficult. Your Delphi app is not able to quess the right
location to pass it's own output.

Some time ago my app created HTML files to be used as simple reports.
You first save the HTML to disk and then use ShellExec to call the
default browser (IE, Firefox, Opera etc.) and give the file path as a
parameter. This works and it is easy.

Then I tried to Google tips how I could pass that file to the system's
Default browser directly, for instance from an address of my
TMemoryStream or something. I had no luck finding any useful tips.
ap
Hans-Peter Diettrich
2010-10-01 17:04:14 UTC
Permalink
Post by Mike Glazer
I am writing a program that at some stage runs a plotting application using
ShellExecut, that takes as its input a datafile. At the moment I create this
datafile as an internediate file. How can I pass the data to the
application without physically saving an intermediate file and then having
to pass its location to the application?
You can do that with Memory Mapped Files (MMF).

Or you connect the plotting application with pipes, and write your data
to the application's input (stdin) pipe.

DoDi
Jamie
2010-10-01 23:30:51 UTC
Permalink
Post by Mike Glazer
I am writing a program that at some stage runs a plotting application using
ShellExecut, that takes as its input a datafile. At the moment I create this
datafile as an internediate file. How can I pass the data to the
application without physically saving an intermediate file and then having
to pass its location to the application?
Mike
check to see if that plotter app has a DDE "Dynamic Data Exchange"
server operating.

Other ways are, if the plotter app has clipboard functions, you can
place it all on the clip board and interact it the app using messages
to force one of it's Paste functions.

Using the "CreateFileMapping" maybe another way.


Jamie.

Loading...