The CIMemory class encapsulates the RT shared memory object; it allows sharing memory between RT and Windows applications. The CIMemory class is typically used as it is.
Constructor
Destructor
Create
GetPointer
GetSize
The following member variables are only available to the members of the class and its derived classes:
DWORD m_dwLen; PVOID m_p; BOOLEAN m_bAllocated;
The constructor has no arguments. It creates an unattached object.
If the object is attached, the destructor detaches it; then it destroys the object.
If the object is already attached, it is first detached. Then this call creates shared memory and attaches it to the object.
DWORD CIMemory::Create( char * pszName, DWORD dwLen, PVOID pAddr );
pszName
dwLen
pAddr
E_OK
E_MEM
E_LIMIT
E_SLOT
E_CONTEXT
E_PARA
With this call the thread obtains a pointer for addressing the memory.
PVOID CIMemory::GetPointer(void);
The result is a pointer that can be used to address the memory (a type cast will be required), or NULL if the call fails.
E_OK
E_EXIST
This call returns the size in bytes of the memory.
DWORD CIMemory::GetSize(void);
The result is the number of bytes in the memory, or 0 if the call fails.
E_OK
E_EXIST