Click here to Skip to main content
15,795,331 members
Articles / Programming Languages / C++

Share memory throuth DLL

Rate me:
Please Sign up or sign in to vote.
1.38/5 (21 votes)
1 May 2006 51.4K   1.1K   25   6
This discussed how more applications share them memory.

Sample Image - Share_memory_throuth_DLL.jpg


Generally, each application has its own data segment. This mearn they are independent where two applications use a dll together. But, sometimes, we want to know what other applications are doing. So we want used a shared memory. There are many ways to do so, use a shared DLL section is one of them.


Following is the simply step to create a shared memory.


1. Create a DLL project.


2. Create a segment named “.shared”, and create shared members at this section.


#pragma data_seg(".shared")<o:p>

      char theBuffer[1024] = "";<o:p>

#pragma data_seg()<o:p>


3. Define this section as shared. This is defined at TheDll.def file.



.shared   READ WRITE SHARED<o:p>


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Written By
Software Developer (Senior)
Australia Australia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

GeneralMy vote of 1 Pin
RenatoK20-May-10 13:31
RenatoK20-May-10 13:31 
GeneralMy vote of 1 Pin
cefarix30-Aug-09 13:31
cefarix30-Aug-09 13:31 
General#pragma... Pin
Amir Dashti29-Dec-08 2:18
professionalAmir Dashti29-Dec-08 2:18 
GeneralBAD BAD BAD Pin
AnasHashki2-May-06 4:32
AnasHashki2-May-06 4:32 
Very bad article
It's very bad

Software Developer
LIFE'S SHORT. If you don't look around once in a while you might miss it

GeneralWhats missing Pin
gri2-May-06 3:04
gri2-May-06 3:04 
GeneralRe: Whats missing Pin
Denny502-May-06 14:28
Denny502-May-06 14:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.