Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2005

Tip: Looking for answers? Try searching our database.

Shared Memory Questions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sutphinwb@nospam.nospam - 10 May 2005 05:56 GMT
Hi

I used shared memory quite a lot for IPC.  The problem is that it is fixed
size so that you cannot place something like a CString in it because CString
will load it's buffer from the local heap which will mean nothing to another
program accessing the pointer.

I was wondering if any of the new CStringT type items or STL "string"
objects can be declared so that the storage is fixed at declaration time.  I
hate using char[], but I have no choice it seems.

It would be really fun to set up a shared heap using a memory manager with
mutexes, etc.  I looked at ACE, but there seems to be a lot baggage.

I'm converting VC 6.0 MFC apps to VC 7.0 and beyond, maintaining MFC for the
most part.

Thanks

Bill
Gary Chang[MSFT] - 10 May 2005 10:53 GMT
Hi Bill,

>I was wondering if any of the new CStringT type items or STL "string"
>objects can be declared so that the storage is fixed at declaration time.

The new CStringT in VC7 is a template class used to manipulate
variable-length character strings by default. The memory to hold these
strings is allocated and released through a string manager object,
associated with each instance of CStringT.

These default string types use a string manager that allocates memory from
the process heap (in ATL) or the CRT heap (in MFC). However, you can
override the default memory management behavior of CStringT, creating
allocators specifically customized to your requirement. For more detaled
infor and related topics, please refer to the following MSDN links:

Memory Management and CStringT
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html
/vcconMemoryManagementCStringT.asp

Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.