Re: Communication between Borland Pascal DOS program and Delphi



Wolf Behrenhoff schreef:
Femme Verbeek schrieb:

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.

The access of the windows clipboard from a BP program is desirable anyway, regardless of whether it solves the OP's question or not.
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
.



Relevant Pages

  • Re: PrintScreen key
    ... xprodata wrote: ... Either one captures the image to the Windows clipboard. ... One problem with the Windows Clipboard is that it will only keep one entry ...
    (microsoft.public.windowsxp.general)
  • RE: Printscreen wont work
    ... you cut/copy. ... hit "print screen"again. ... >> windows XP. ...
    (microsoft.public.windowsxp.hardware)
  • Re: Adding pdf or other files to FP pages
    ... pressing printscreen copies the current active window to the windows clipboard, ... so you just cut-and-paste into your image editor. ... | or jpgs first otherwise they'll want to open in Adobe ...
    (microsoft.public.frontpage.client)
  • Re: Screen shots
    ... Prt-Scrn captures the whole screen to the Windows Clipboard. ... It's a Dell Keyboard ...
    (microsoft.public.windowsxp.general)
  • Re: Hello Everyone!
    ... Yes, but the same is true for 64-bit Linux, ... is a protected mode) it no longer supports real mode or V86 mode. ... DOS-specific hardware call from within one of those Windows ... The only way to execute 16-bit real mode code on 64-bit operating ...
    (comp.os.linux.misc)