Global Shared Memory Library for Windows

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Global Shared Memory Library for Windows

Post by Rings »

If you ever want share Memory between your Appzs (or games ;) )
this Userlib can comes very handy.
You can allocate memory that is usable between processes.
The Library is free for use in any commercial or private Appzs (or game)

Download here

have fun with this nice present from me ,

S.Rings in march 2005

from the ReadMeFile (and no, i don't write any more docu )
--------------ReadmeFile, 1.th march 2005-------------------

Description: Userlib for Purebasic, tested version 3.93

Purpose: Share Blocks of Memory between different Processes (EXE's) and Threads (DLL's)

Copyright: 2004-2005 by Siegfried Rings

License: Free of use in any commercial or private application

Sourcecode: Available at xtra costs ,or just offer me something ;)

---------------------------------------------------------------
2 Commands are available, Normaly only 1 is needed.
The most important command is to allocate the global memory,
do this with the AllocateMemoryGlobal-Command:


Usage:

You define a Block of memory wuth this Command:


MemoryAddress.l =AllocateMemoryGlobal(Name.s,Size.l)


where

Name.s is a string with an unique Name for this Block
Size.l is the size to allocate in bytes.
MemoryAddress is the returnvalue from the function,
it is NULL if it fails, else it is a value address in Memory
Where you can Peek/Poke and CopyMemory .


The other Command (normaly not needed) is the FreeMemoryGlobal Command

Result=FreeMemoryGlobal(MemoryAddress.l)

---------------------------------------------------------------------

How to use the example:


To Test this library, you have to start 2 instances of the example file.
in the example file there were allocate 5 Blocks of shared memory.
You can edit the String (first mark a entry in the Listgadget),
that should been share with the Set command.
Too easy to describe.

----------------------------------------------------------------------
Why i wrote this lib ?
Yes, i have written several services (Native NT_services) in Purebasic (A userlib is also ready for this)
and i have to control and share Datas from a control-panel or Icontray Programm with them .
One way was using a file, but using Memory was a way faster then.


Have fun, Siegfried Rings, 1.3.2005
SPAMINATOR NR.1
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Re: Global Shared Memory Library for Windows

Post by traumatic »

Rings wrote:have fun with this nice present from me
Thank you :D
Good programmers don't comment their code. It was hard to write, should be hard to read.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Thank you very much :D
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply