Click here to Skip to main content
15,897,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: endless loop interruption Pin
Ceri14-Jan-03 22:06
Ceri14-Jan-03 22:06 
QuestionHow can I get the standard size of a control before creation ? Pin
JohnMcL13-Jan-03 22:46
JohnMcL13-Jan-03 22:46 
AnswerRe: How can I get the standard size of a control before creation ? Pin
Alvaro Mendez14-Jan-03 7:10
Alvaro Mendez14-Jan-03 7:10 
GeneralRe: How can I get the standard size of a control before creation ? Pin
JohnMcL15-Jan-03 14:10
JohnMcL15-Jan-03 14:10 
GeneralNon ascii character in CSV file Pin
Alberto Bar-Noy13-Jan-03 22:30
Alberto Bar-Noy13-Jan-03 22:30 
GeneralRe: Non ascii character in CSV file Pin
Ted Ferenc13-Jan-03 22:43
Ted Ferenc13-Jan-03 22:43 
Generalnew&delete, malloc&free Pin
raner13-Jan-03 22:26
raner13-Jan-03 22:26 
GeneralRe: new&delete, malloc&free Pin
jhwurmbach13-Jan-03 22:46
jhwurmbach13-Jan-03 22:46 
raner wrote:
However when the application is terminated, will this resources be freed?

Yes. In debug mode, the IDE shows nasty comments about the leaks, but thats it.
So, if your app starts, runs a second, leaking a few KB of memory and terminates, no harm is done.
But if you imagine MS-Word would leak one byte per keystroke, you see how this would lead to trouble.
Basically, dont leak at all! It is not that hard to acomplish if you are careful:
Drop char* in favor of std::string or CString, drop dynamic C-arrays in vavor of std::vector etc.
Those pointers that you need are initialised at creation, checked against NULL before use and set to NULL after the delete.


raner wrote:
Once, i've created an object with "new" in a loop and was unable to delete the object outside the loop.Anyone knows why?

You threw away the pointer to this object, eg. overwriting it in the next loop iteration?


Remember:
My opinions may have changed, but not the fact that I am right.
GeneralRe: new&delete, malloc&free Pin
raner14-Jan-03 0:19
raner14-Jan-03 0:19 
GeneralRe: new&delete, malloc&free Pin
jhwurmbach14-Jan-03 1:08
jhwurmbach14-Jan-03 1:08 
GeneralThks jhwurmbach & AlexO Pin
raner14-Jan-03 20:56
raner14-Jan-03 20:56 
GeneralRe: Thks jhwurmbach & AlexO Pin
jhwurmbach14-Jan-03 22:59
jhwurmbach14-Jan-03 22:59 
GeneralRe: Thks jhwurmbach & AlexO Pin
raner15-Jan-03 3:54
raner15-Jan-03 3:54 
GeneralRe: new&delete, malloc&free Pin
AlexO14-Jan-03 4:20
AlexO14-Jan-03 4:20 
GeneralWord Automation Pin
Exceter13-Jan-03 18:56
Exceter13-Jan-03 18:56 
GeneralRe: Word Automation Pin
Anonymous13-Jan-03 20:40
Anonymous13-Jan-03 20:40 
GeneralMAC based Firewall Pin
summo13-Jan-03 18:11
summo13-Jan-03 18:11 
GeneralRe: MAC based Firewall Pin
Dana Epp15-Jan-03 9:02
Dana Epp15-Jan-03 9:02 
Generalproblem in debugging VC 6 code in windows xp Pin
r i s h a b h s13-Jan-03 16:45
r i s h a b h s13-Jan-03 16:45 
General*.pck file Pin
:_Rocket_:13-Jan-03 16:04
:_Rocket_:13-Jan-03 16:04 
GeneralRe: *.pck file Pin
Taka Muraoka13-Jan-03 17:38
Taka Muraoka13-Jan-03 17:38 
GeneralRe: *.pck file Pin
Ted Ferenc13-Jan-03 22:54
Ted Ferenc13-Jan-03 22:54 
Generalmodeless dialog(rather long story), I appreciate Pin
Anonymous13-Jan-03 15:29
Anonymous13-Jan-03 15:29 
GeneralRe: modeless dialog(rather long story), I appreciate Pin
Joaquín M López Muñoz13-Jan-03 20:58
Joaquín M López Muñoz13-Jan-03 20:58 
GeneralRe: modeless dialog(rather long story), I appreciate Pin
Hans Ruck13-Jan-03 22:02
Hans Ruck13-Jan-03 22:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.