Click here to Skip to main content
Licence 
First Posted 1 May 2006
Views 32,403
Bookmarked 23 times

Share memory throuth DLL

By | 1 May 2006 | Article
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")

      char theBuffer[1024] = "";

#pragma data_seg()

 

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

 

SECTIONS

.shared   READ WRITE SHARED

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

About the Author

Denny50

Software Developer (Senior)

Australia Australia

Member

Senior software engineer with 10 years experience of C/C++ programming. Now also has some project with C#. I'm from Shanghai and now working at Melbourne. At I spare time, I enjoy my family life. My blog, Childhood is a collection about my family, epically my lovely son. Most of them write in Chinese, and a few in my poor English - please forgive me, I'm improving my English as soon as I can.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 1 PinmemberRen33312:31 20 May '10  
GeneralMy vote of 1 Pinmembercefarix12:31 30 Aug '09  
General#pragma... PinmemberAmir Dashti1:18 29 Dec '08  
GeneralBAD BAD BAD PinmemberThe_Myth3:32 2 May '06  
GeneralWhats missing PinPopularmembergri2:04 2 May '06  
GeneralRe: Whats missing PinmemberDenny Wang13:28 2 May '06  

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

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

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 1 May 2006
Article Copyright 2006 by Denny50
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid