Hi,
I am having trouble using offset_ptr. I want to dynamically allocate
memory in windows shared memory and create a point to it so it can be
used by two different processes. I figures I would create a named
object in the shaed memory to contain the pointer to the memmory, but
when I try it I get a compile error. Here is the code I have so far.
Note the the the shared memory is created elsewhere and it is big enough.
bip::managed_windows_shared_memory* pAldisSharedMemory = new
bip::managed_windows_shared_memory(bip::open_only,
ALDIS_SHARED_MEMORY_NAME.c_str());
if (pAldisSharedMemory)
{
bip::offset_ptr<char> pImageData;
//
// This line causes the following error. Error 1 error C2440:
'initializing' : cannot convert from //'
//boost::interprocess::offset_ptr<PointedType> *' to 'char *'
//C:\stopbar\3rdParty\boost\include\boost\interprocess\offset_ptr.hpp
111 AldisHardware
//
pImageData =
pAldisSharedMemory->find_or_construct
participants (1)
-
Rex Battenberg