Click here to Skip to main content
15,881,812 members
Articles / Programming Languages / C++
Article

Share memory throuth DLL

Rate me:
Please Sign up or sign in to vote.
1.38/5 (21 votes)
1 May 2006 51.8K   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.

<o:p> 

Following is the simply step to create a shared memory.

<o:p> 

1. Create a DLL project.

<o:p> 

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

<o:p> 

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

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

#pragma data_seg()<o:p>

<o:p> 

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

<o:p> 

SECTIONS<o:p>

.shared   READ WRITE SHARED<o:p>

License

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 12:31
RenatoK20-May-10 12:31 
Not explained well
Title is misspelled
It doesn't allow for the most basic of functionality (eg: writing different data types)
GeneralMy vote of 1 Pin
cefarix30-Aug-09 12:31
cefarix30-Aug-09 12:31 
General#pragma... Pin
Amir Dashti29-Dec-08 1:18
professionalAmir Dashti29-Dec-08 1:18 
GeneralBAD BAD BAD Pin
AnasHashki2-May-06 3:32
AnasHashki2-May-06 3:32 
GeneralWhats missing Pin
gri2-May-06 2:04
gri2-May-06 2:04 
GeneralRe: Whats missing Pin
Denny502-May-06 13:28
Denny502-May-06 13: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.