Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Old References 2

Status
Not open for further replies.

porto99

Technical User
Nov 1, 2004
96
GB
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?
 
Close Visual Studio, delete the .ncb file and restart Visual Studio. It will rebuild the .ncb file for the new structure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top