Click here to Skip to main content
Click here to Skip to main content

Share memory throuth DLL

By , 1 May 2006
 

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

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 1membercefarix30 Aug '09 - 12:31 

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

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