Re: Communication between Borland Pascal DOS program and Delphi
- From: Femme Verbeek <fv@xxxxxxxxxxxxxxxx>
- Date: Tue, 14 Mar 2006 02:29:47 +0100
Wolf Behrenhoff schreef:
Femme Verbeek schrieb:The access of the windows clipboard from a BP program is desirable anyway, regardless of whether it solves the OP's question or not.
Dr John Stockton schreef:
A BP program can start any 32 bit windows program simply with exec(....)
If you know how to do it between two windows programs, a very simple method would be to let the BP application start a tiny 32 bit consolemode progam at the moment the event should occur. The 32 bit program creates the event for the dos program e.g. by putting a message on the windows clipboard or in shared memory.
Since a message can be conveyed with a Longint or a short ShortString,
ISTM that it should be practical and could be useful for someone to
write a minimal such 32-bit program, with a parameter to identify (if
appropriate) the means of transfer, a parameter for the data type, and a
parameter for the date -- or whatever parameters are actually needed.
Why so difficult. Just a string containing any information you like makes it a universal tool
ok, here it is:
(...)
Run it from a bp application in the following way
Program testmsg;
uses dos;
{$M 8192,0,0}
begin
swapvectors;
exec(getenv('COMSPEC'),'/c msg2clip.exe Hello World');
swapvectors;
end.
You can use interrupt 2Fh, AX=1703h to set clipboard data. Calling an
external program has several disadvantages - one of them being execution
speed. You don't want to do that.
I actually found some code
http://www.pedt.demon.co.uk/usenet/clip.zip
(to Pedt: line 8 in clipbrd.pas DPMI is misspelled
line 14 in testclip.pas: Lower := ST; is missing )
It works in win95 but only in real mode.
It does not work in WinXP. Tried all the compatibility modes, but no success.
Anyway, I don't recommend using the clipboard for communication between
two programs. That's not what it is for! The user doesn't expect a
program to change the content of the clipboard! Maybe there are some
functions which allow a DOS program to talk to windows. Have a look at
Ralf Brown's interrupt list, it can MAYBE help you (maybe not, I don't
know).
Sometime ago there was a long discussion here about the same subject. IIRC there was no satisfying solution then.
-- Femme
.
- Follow-Ups:
- Re: Communication between Borland Pascal DOS program and Delphi
- From: Marco van de Voort
- Re: Communication between Borland Pascal DOS program and Delphi
- References:
- Communication between Borland Pascal DOS program and Delphi
- From: eljainc
- Re: Communication between Borland Pascal DOS program and Delphi
- From: Femme Verbeek
- Re: Communication between Borland Pascal DOS program and Delphi
- From: Dr John Stockton
- Re: Communication between Borland Pascal DOS program and Delphi
- From: Wolf Behrenhoff
- Communication between Borland Pascal DOS program and Delphi
- Prev by Date: Re: Communication between Borland Pascal DOS program and Delphi
- Next by Date: Re: Communication between Borland Pascal DOS program and Delphi
- Previous by thread: Re: Communication between Borland Pascal DOS program and Delphi
- Next by thread: Re: Communication between Borland Pascal DOS program and Delphi
- Index(es):
Relevant Pages
|
Loading