Using Shared Memory with a large structure, but when I start a new project using the current one as a basis, the names referenced in the structure are the old names and not the new names. This is using Visula Studio .Net
If I type in the new names then All OK, but if I select old name from list error (as would expect). But how to arrange for the display of new structure items in the list.
Is this an IDE bug or does the registry need a tidy up (and how).
struct TSharedMemory{
....
....
};
// Try to create file mapping object for the data(assume that this is the
server)
g_hMap = ::CreateFileMapping((HANDLE) 0xFFFFFFFF,
NULL,
PAGE_READWRITE,
0,
sizeof(TSharedMemory),
"TP_SharedMem"
);
if(g_hMap == NULL)
{
int s = GetLastError();
g_szFormatting.Format ("Shared Memory Not Obtained (Signals); Error = %d",
s);
AfxMessageBox(g_szFormatting);
}
else
{
// Obtain a pointer from the handle to file mapping object
g_hMap =
(TSharedMemory*)::MapViewOfFile(g_hMap,FILE_MAP_WRITE,0,0,sizeof(TSharedMemory));
// Clear down the current project saved setting structure
memset(g_pMem, 0, sizeof(TSharedMemory));
}
memcpy(&g_pMem->tips.buffer, &BCbuffer.data , sizeof(BCbuffer.data));
i.e. when you type &g_pMem-> it is the old names that are shown.
How can the old references be cleared out?
If I type in the new names then All OK, but if I select old name from list error (as would expect). But how to arrange for the display of new structure items in the list.
Is this an IDE bug or does the registry need a tidy up (and how).
struct TSharedMemory{
....
....
};
// Try to create file mapping object for the data(assume that this is the
server)
g_hMap = ::CreateFileMapping((HANDLE) 0xFFFFFFFF,
NULL,
PAGE_READWRITE,
0,
sizeof(TSharedMemory),
"TP_SharedMem"
);
if(g_hMap == NULL)
{
int s = GetLastError();
g_szFormatting.Format ("Shared Memory Not Obtained (Signals); Error = %d",
s);
AfxMessageBox(g_szFormatting);
}
else
{
// Obtain a pointer from the handle to file mapping object
g_hMap =
(TSharedMemory*)::MapViewOfFile(g_hMap,FILE_MAP_WRITE,0,0,sizeof(TSharedMemory));
// Clear down the current project saved setting structure
memset(g_pMem, 0, sizeof(TSharedMemory));
}
memcpy(&g_pMem->tips.buffer, &BCbuffer.data , sizeof(BCbuffer.data));
i.e. when you type &g_pMem-> it is the old names that are shown.
How can the old references be cleared out?