Autor Beitrag
Christian V.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 311

Win Xp Prof
Turbo Delphi 2005
BeitragVerfasst: Sa 05.03.05 11:20 
hallo, ich möchte dasss zwei Tasks miteinander kommunizieren können. Der Client stellt die Anfrage, der Server wertet sie aus, und gibt das resultat zurück. Wie kann ich das am besten realisieren?
Ich habe mir gedacht ich mache es mit messages. Doch wie kann ich messages verschicken und in der anderen Anwendung abfangen?
freue mich auf antworten.
Invulnerabilis

_________________
Hardware runs the world, software controls the hardware, code generates software - Have You already coded today?
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 05.03.05 11:28 
Schau dir mal Suche in: Delphi-Forum, Delphi-Library DDE (Suche bei Google DDE) bzw. Suche im MSDN SENDMESSAGE (bzw. Suche in: Delphi-Forum, Delphi-Library SENDMESSAGE oder in der OH) an

AXMD
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 05.03.05 14:03 
Eine Möglichkeit wär WM_COPYDATA ( www.luckie-online.de...ges/WM_COPYDATA.html ). Dann wären da Pipes, mit denen geht es wohl auch und es gibt noch Memory Mapped Files (MMF).
Christian V. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 311

Win Xp Prof
Turbo Delphi 2005
BeitragVerfasst: Sa 05.03.05 14:30 
Hallo, danke für die antworten, aus dem ersten werde ich nicht so recht schlau, aber mit dem zweiten könnte es klappen.
Ich werds mal ausprobieren.

_________________
Hardware runs the world, software controls the hardware, code generates software - Have You already coded today?
Christian V. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 311

Win Xp Prof
Turbo Delphi 2005
BeitragVerfasst: Di 08.03.05 09:15 
Client:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
protected
     procedure send();
type
Tsenddata=packed record
   mode:integer;
   root2:Hkey;
   schluessel,value,okey,key:string;
end;
PmyRecord=^Tsenddata;
procedure TForm1.send;
var
senddata:PmyRecord;
cds:Tcopydatastruct;
hwnd:Thandle;
begin
   Getmem(senddata,sizeof(senddata));
   try
   cds.dwData:=0;
   cds.cbData:=sizeof(senddata);
   cds.lpData:=Senddata;
   hwnd:=FindWindow('Tfgghfggh',nil);
   SendMessage(hwnd,Wm_Copydata,Handle,Integer(@cds));
   finally
   Freemem(senddata,sizeof(senddata));
   end;
end;



Server-Service:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
 public
    function GetServiceController: TServiceController; override;
    procedure GetMessage(var msg:TWMCopyData); message WM_COPYDATA;
    { Public-Deklarationen }
  end;

var
  fgghfggh: Tfgghfggh;

implementation

{$R *.DFM}
type
Tsenddata=packed record
   mode:integer;
   root:Hkey;
   schluessel,value,okey,key:string;
end;
PmyRecord=^Tsenddata;

procedure Tfgghfggh.GetMessage(var msg:TWmcopyData);
var

senddata:PMyRecord;
mode:integer;
root:Hkey;
schluessel,value,okey,key:string;
begin
mode:=PMyRecord(msg.CopyDataStruct.lpdata)^.mode;
root:=PMyRecord(msg.CopyDataStruct.lpdata)^.root;
schluessel:=PMyRecord(msg.CopyDataStruct.lpdata)^.schluessel;
key:=PMyRecord(msg.CopyDataStruct.lpdata)^.key;
okey:=PMyRecord(msg.CopyDataStruct.lpdata)^.okey;
value:=PMyRecord(msg.CopyDataStruct.lpdata)^.value;
ShowMessage('Es funktioniert');
end;

was stimmt an dem nicht
@Luckie, sehr gutes beispiel

_________________
Hardware runs the world, software controls the hardware, code generates software - Have You already coded today?