You are right. It compiles fine in release mode. This is new and weird to me...
How am I supposed to debug my app then?
In the implementation file you are using, you could look for the #define new statement and remove it. If you want to keep the ability to detect memory leaks from that code, you can change it to #define TNEW, add a #else clause with #define TNEW new, and then replace all standard calls to new with TNEW.
But when I search for it, the only two instances of 'define new' are the standard one below in my dialog and app .cpp files. Could it be defined some other way? Or any other workaround to make it compilable in debug mode?
Sorry for the late reply - did you get this working?
The line with the warning should be just
As I mentioned before, I'm just not sure where this should be in a template class.
Since the actual class is built where an object is instantiated, I'm not sure if
the #undef stuff needs to be there or if it worke by putting it in the template declaration.
If it works in the template declaration (as you've shown) then that's cool
It's easy enough to test.
i am an amateur in VC++! i ve got a problem and that is by pressing Enter Key of keyboard, my program shuts down as i guess its by default!
Now my program uses a text box and what i want is is when i write something and press Enter! the Enter key activate an Event Handler! or a specified function say displaying the text what is written in the text box in other list box etc!
plzz anyone who can help in this regard!
also is there any way to creat my own event handler????
Like for Enter key? as there is one for helpinfo with WM_HELPINFO which activates if F1 is pressed!
I ll be grateful if anyone lead me to the solution!
In a Dialog box the enter key causes the OnOK method to get called.
There are a couple of ways you can do this, you can do your processing in OnOK but not call CDialog::OnOK, and to make the OK button work again, you will need to add an event handler for the ok button and in there call CDialog::OnOK.
Or you can catch the WM_KEYDOWN message for the VK_ENTER key in PreTranslateMessage and do your processing there, but don't call CDialog::PreTranslateMessage when the enter key is pressed.
well i didn get ya !
wat i wanna do is to use tht Enter key for activating any of my desired button! Like say a button Send! if i write something in the text box and press Enter! it works if i ve CLICKED Send!
i ll be grateful if u clearify it a bit!
well i havent used OnOK() Handler! and truelly speakin i dunno well abt tht! i do know tht Enter key initiate the OnOK() handler and so the program closes! but how to remove this property from enter key?
u know clicking Send Button while working in a TextBox is cumbersome! just like chat in msn messenger or yahoo ones window! where when we press Enter! or wat u call RETURN the message is sent or we can say tht Send button is activated!
Last Visit: 31-Dec-99 18:00 Last Update: 25-Jul-21 4:44