Click here to Skip to main content
14,972,640 members

Comments by Michael Waters (Top 7 by date)

Michael Waters 8-Dec-16 19:04pm View
   
That's the best option that I have been able to find, but I've had some trouble getting to work.
Michael Waters 3-May-11 12:47pm View
   
It's been a couple of weeks since I had a chance to implement this approach, and I ran into another obstacle. It seems that CString (which I'm using as the key to my hash table implementation) doen't overload the inplace new operator at all. So even after I derive a class from CString and overload it's inplace new operator, the compiler still spits out that it doesn't recognize the class-specific inplace new operator. I couldn't figure out WHY that was the case, until I ran across the following http://www.gotw.ca/publications/mill15.htm
, which explained why it is if CString doesn't overload the inplace new, my own overload won't compile.

So, it looks like I will have to rewrite my hash table to use a different key (probably a copy of CString, with the appropriately overloaded new operator), but I doubt I'll get a chance to do that level of rewrite any time in the near future. I thiknk I will go ahead and accept this solution, tentatively, since I'm pretty sure, from my research, that this approach will prove correct.

That's an awful lot of work just to make _DEBUG report line numbers! And here I thought I was asking a question that was going to have a simple solution :)
Michael Waters 19-Apr-11 17:14pm View
   
I only undefine the debug version for the one particular code block - and I might mention that when I tracked down the MFC code and saw what it was doing, it explained all those CMap memory leaks reported in the Output window that didn't have line numbers attached to them. I would think after all these years, the MFC code would have been modified with a better work around than just "don't do that".
Michael Waters 19-Apr-11 17:10pm View
   
Interesting approach, but I don't think it's quite the solution I need.
Michael Waters 19-Apr-11 17:06pm View
   
But the issue of the inplace syntax is key (literally). I have a string hash table with a previously allocated bucket, practically a copy of CMapStringToOb (that's how I found my soltion, because it's what Micorsoft does), and it uses the inplace syntax to instantiate an empty string key for each new bucket in the hash. I'll try your approach and see what happens.
Michael Waters 26-Oct-10 11:40am View
   
We already store an individual object archive number, but I want to add the _WIN_VER dependency to cover all the bases, since we have multiple users with multiple versions of the application floating around out there, and thse are mission critical data files. Sure, we can tell all of our users to upgrade to the latest build of the software, but experience has shown us that users don't always listen to us.
Michael Waters 26-Oct-10 11:32am View
   
Wow, that was fast! I love Code Project. Thanks for the help.

So the change occurred between _MFC_VER 0x0700 and _MFC_VER 0x0710. The problem lies in that the files store a mixture of both BOOL (code dating from before bool was part of the C++ standard) AND bool values. I'm trying to migrate it all to use bool only, but it's a slow process as we finally transition from Studio 6 to Studio 10.