common memory area

Previous topic - Next topic

Qedo

It is  possible in GLBasic runs in parallel (multitasking?) two (or more) programs  and to share a common memory area?
I think it would be useful the use of pointers but is not possible in GLBasic
Perhaps using INLINE. Does anyone have any examples?
Ciao

hardyx

You can make a DLL library to share the data without access directly to the memory, instead use shared DLL variables.

Moru

or you could use networking to talk to the different instances. Not as fast so if you are doing something heavy I guess this isn't what you want :-)

hardyx

You'r right, DLL code is shared for applications, but data is not shared, each program has his own data. Code is in the DLL memory space, and data is in the main app address space. You can share data between two apps using FileMapping in Windows. You create a shared memory area with the desired size and map in the libray memory. You can copy the data you want to share there. You must to use pointers, wich you can manage in GLBasic using INLINE code.

http://msdn.microsoft.com/en-us/library/ms686958%28v=vs.85%29.aspx

Dark Schneider

But it will not work on sandboxed devices, like iPhone and probably Android, so you should search for another solution in your program.

Kitty Hello

What are you trying to achieve in detail? I think there's a much better way.