Autor Beitrag
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: So 21.12.03 21:44 
Hallo,

ich will Daten an eine andere Programm-Instanz schicken.

Zuerst wollte ich mit ReadProcessMemory() arbeiten, aber das geht nicht so toll. Mit GlobalAlloc tut's auch nicht, da ich damit nur aus dem Erzeuger-Prozess zugreifen kann. Was gibt es denn allgemein für Möglichkeiten, Daten (also Speicher) global auszutauschen, so dass ich als Parameter max. 8 Bytes (wegen SendMessage) übergeben muss? Das Ganze soll auch dann noch tun, wenn die Instanz, die die Daten erzeugt und versendet hat, beendet ist.

_________________
Life is a bad adventure, but the graphic is really good!
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 21.12.03 21:50 
Hallo!

Mit WM_SENDDATA kannst Du einen Pointer auf eine beliebige Datenstruktur von einem Programm an ein anderes übergeben. Einfach mal im Forum danach suchen, es gibt da einen FAQ- oder Tutorial-Eintrag zu.

MfG
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Andreas Pfau Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: So 21.12.03 21:53 
Hallo,

ich sollte dazusagen: Ich will es mithilfe von RegisterWindowMessage() machen.

Außerdem: wenn ich einen Pointer verschicke, verfallen die Daten, wenn die Sender-Instanz beendet wird...

_________________
Life is a bad adventure, but the graphic is really good!
UC-Chewie
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 531

WinXP
D5 Ent
BeitragVerfasst: So 21.12.03 21:53 
IPC-Möglichkeiten (Interprocess Communication) gibt es unter Windows mehrere.
Hier in Assarbads Tutorial werden sie genannt und erklärt.

_________________
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind
UC-Chewie
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 531

WinXP
D5 Ent
BeitragVerfasst: So 21.12.03 21:55 
Andreas Pfau hat folgendes geschrieben:
Außerdem: wenn ich einen Pointer verschicke, verfallen die Daten, wenn die Sender-Instanz beendet wird...


Dann würden sich Filemappings anbieten. Dort erhälst du einen Speicherbereich, der von allen Prozessen verwendet werden kann.
Wie das geht, steht auch in Assarbads Tutorial.

_________________
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind
Andreas Pfau Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: So 21.12.03 21:57 
Hallo,

aber dazu muss ich doch eine Datei auf der HDD erzeugen, oder? Ist das nicht langsam? Ich verstehe FileMapping nicht so recht...

_________________
Life is a bad adventure, but the graphic is really good!
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 21.12.03 22:04 
@Peter Lustig: du meinst wohl WM_COPYDATA

Bei WM_COPYDATA mappt Windows die zu verschickenden Daten automatisch in den Prozess des Zielfensters... Nur Pointer auszutauschen würde sowieso nichts bringen, da Pointer immer nur im Adressraum des eigenen Prozesses gültig sind...!

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Andreas Pfau Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: So 21.12.03 22:37 
Hallo,

habe mir das mal angeschaut... jetzt tut es, ich habe das mit MMF verstanden. Danke!!! :D

_________________
Life is a bad adventure, but the graphic is really good!
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 21.12.03 22:48 
@Motzi: ja und ja! (beides vergessen, ist ja schon spät; das mit dem Speicher musste so sein, sonst würde meine Anwendung (C++ und Delphi gemischt nutzen) gar nicht funktionieren) :)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".