I'm trying to create a CMap that stores three different types of messages that I recieve from a number of sources. I am using a CMap because I will have a large number of sources and need to search the list using a unique identifier for each source. The struct contains 3 CString variables to store the variable length messages.
When I try to compile I get the following warning: ...afxtempl.h(74) : warning C4291: 'void *__cdecl operator new(unsigned int,void *)' : no matching operator delete found; memory will not be freed if initialization throws an exception
What I can't figure out is where to add a delete operator. It looks like the new() function is defined in iabitsyx\mfc\include\wcealt.h(244) but there isn't a delete function. Any clues? I'm not sure I want to edit MFC include files.
I think I have this figured out. The MGC include files claim there isn't a in Win CE (even though there is one in the include folder). So they put the following definition in afxtemp.h
// There is no new.h for WinCE, so we define a placement new here. inline void * operator new(size_t, void * ptr) { return ptr; }
However, they never define a delete() that corresponds. Looking in new.h the following is defined:
But for some reason eVC/WinCE doesn't include so I copied the delete function to be global in my MessageMap.h file and it suddenly compiles without complaint.
Seems like this is a bug in the include files for the platform I'm using. The files are in the following directory: "Windows CE Tools\wce410\IABITSYX\Include\Armv4i\"