473,322 Members | 1,614 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Shared Memory Questions

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
Nov 17 '05 #1
1 1113
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/de...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...sdn/nospam.asp
&SD=msdn

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

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jason | last post by:
I'm working on a project to cleanup our current XML handling code. We basically just dump our shared memory information (a set of C structs that represent configuration data) to an XML...
2
by: Trevor Oakley | last post by:
I am writing thousands of html pages from an MS SQL source using a DataSet and then an XslTransform. I have an interest in making the code run faster as it takes several minutes (sometimes ten...
2
by: Paulo da Silva | last post by:
Hi. I am writing a shared library to override some libc functions. I have the following questions: Ex. int XXX=0; void f() {++XXX; ...; --XXX;}
7
by: Mark Kamoski | last post by:
Hi Everyone-- Please help. What are the implications, (in terms of memory, application footprint, resource use, threading, and so forth), of using Shared methods? These Shared classes raise...
3
by: Grandpa Pete | last post by:
How can I share resources across all users of a web service for read/write access. *Situation* *one*: I want to have an in memory counter that all users of the webservice could access. Call...
6
by: Lee Crabtree | last post by:
I'm serializing an object into a file in XML. After the object is serialized, some other relevant data is written into the file. The rest of the data winds up being very large most of the time. ...
0
by: Morantex | last post by:
Morantex announce the availability of the first beta preview of Persistore for Windows x86 and x64. This technology combines shared memory, data, and object persistence in a .NET component for the...
11
by: eBob.com | last post by:
I have this nasty problem with Shared methods and what I think of as "global storage" - i.e. storage declared outside of any subroutines or functions. In the simple example below this "global"...
2
by: oopsatwork | last post by:
Ok...so, I have been outside of the C world for a _very_ long time...but not so long as to remember how to do multidimensional arrays. So, let me state that I know how to malloc pointers to...
3
by: S S | last post by:
Hi Are there some known issues using STL with shared library. Recently I got some crash for which the reason I dont see any, and searching on goolge shown some such issues with shared library. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.