Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2002-04

FPC win32 memory mapped files for IPC

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Peter H.M. Brooks

I have just recently started doing some work in win32 - my previous programming has been with Unix.

I want to share memory between two processes and use free Pascal to do it.

I first read some old documentation that led me to believe that DLLs would be the answer - they are required, but the code is copied into each process that rather defeats the object of a shared library.

So, I now realise that I need to use memory mapped files, createfilemapping, openfilemapping and mapviewoffileex - so that I can map the file (actually the pagefile) to my variable space and have the inter-process data sharing that I need. The only example I can find is in c, on the ms site.

Surely people are doing this in free Pascal all the time? Does anybody have some sample code that simply arranges for the global variables in the DLL to be available as shared memory to all processes using the DLL?

If anybody has an example, or any better suggestions, please let me know.

Great men are almost always bad men. Lord Acton Great men are almost always bad men. Lord Acton

Reply by email