Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Jun : Share data between Application.
| Subject: | Share data between Application. |
| Posted by: | "Daniel" (dani..@borland.com) |
| Date: | Fri, 23 Jun 2006 15:52:09 |
Hi,
I know using CreateMapFile() to share data between processes. But my
data isn't allocated in continuous memory block but in link list. So....
I tried an application with ShareMem.pas used at the very first Uses
section, can share its data with called DLL (also use ShareMem.pas in the
first) without problem.
But how can I share data with another application?
let said I have two applications, A and B.
I use ShareMem.pas in both A and B. Then I passing data pointer (stored
in wparam) from A to B by using....
type
pMyData=^myData;
MyData=record
a,b,c:integer;
next:pMyData;
end;
var
data:MyData;
in A:
data.a:=1; data.a:=2; data.a:=3;
wParam:=integer(@data);
PostMessage(HWND_BroadCast,WM_SendEzfCam, WParam, LParam);
in B:
I can get message "WM_SendEzfCam" in B, and lParam value. Then I tried
typecast it...
data:=pMyData(WParam)^;
but the data is (0,0,0, nil) all the time.
Can't A and B share Data even they use ShareMem.pas?
Thanks,
Daniel