Click here to Skip to main content
15,910,358 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Internationalization Pin
Aswin Kumar13-Jan-03 17:50
Aswin Kumar13-Jan-03 17:50 
GeneralRe: Internationalization Pin
Ted Ferenc14-Jan-03 21:31
Ted Ferenc14-Jan-03 21:31 
QuestionIJL - where to get it ? Pin
s98769012-Jan-03 23:20
s98769012-Jan-03 23:20 
AnswerRe: IJL - where to get it ? Pin
xxhimanshu13-Jan-03 0:23
xxhimanshu13-Jan-03 0:23 
GeneralRemote-Access to another PC Pin
Harald Diel12-Jan-03 22:13
Harald Diel12-Jan-03 22:13 
GeneralRe: Remote-Access to another PC Pin
benjymous12-Jan-03 23:41
benjymous12-Jan-03 23:41 
Generalwarning and memory leak! Pin
r i s h a b h s12-Jan-03 20:29
r i s h a b h s12-Jan-03 20:29 
GeneralRe: warning and memory leak! Pin
Joaquín M López Muñoz12-Jan-03 21:23
Joaquín M López Muñoz12-Jan-03 21:23 
char *CConfig::InputFilePath ()
{
...
char iPath[MAXCHARS];
...
return iPath;
}
The problem is very accurately described by the warning you're having. iPath gets destroyed as soon as InputFilePath exits, so returning its address is illegal. The simplest solution, probably, is to return a CString:
CString CConfig::InputFilePath ()
{
...
char iPath[MAXCHARS];
...
return iPath; // constructs a CString on the fly from iPath
}
Even if this fix works, I'd strongly suggest that you try to fully understand why your problem was happening, since it is a common error in beginners and something similar could shoot you in the future when least expected.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: warning and memory leak! Pin
r i s h a b h s12-Jan-03 21:43
r i s h a b h s12-Jan-03 21:43 
GeneralRe: warning and memory leak! Pin
Joaquín M López Muñoz12-Jan-03 21:50
Joaquín M López Muñoz12-Jan-03 21:50 
GeneralRe: warning and memory leak! Pin
r i s h a b h s12-Jan-03 21:58
r i s h a b h s12-Jan-03 21:58 
Generalcan any one help me with the memory leak Pin
r i s h a b h s12-Jan-03 23:16
r i s h a b h s12-Jan-03 23:16 
GeneralRe: can any one help me with the memory leak Pin
Alvaro Mendez13-Jan-03 4:34
Alvaro Mendez13-Jan-03 4:34 
GeneralRe: can any one help me with the memory leak Pin
Daniel Turini13-Jan-03 4:53
Daniel Turini13-Jan-03 4:53 
GeneralRe: can any one help me with the memory leak Pin
Tim Smith13-Jan-03 6:45
Tim Smith13-Jan-03 6:45 
GeneralGraphics Pin
chepuri_uk12-Jan-03 19:53
chepuri_uk12-Jan-03 19:53 
GeneralRe: Graphics Pin
includeh1013-Jan-03 0:06
includeh1013-Jan-03 0:06 
GeneralDiscovering DLLs Functions and Parameters Pin
Huttami12-Jan-03 19:34
Huttami12-Jan-03 19:34 
GeneralRe: Discovering DLLs Functions and Parameters Pin
includeh1013-Jan-03 0:15
includeh1013-Jan-03 0:15 
GeneralRe: Discovering DLLs Functions and Parameters Pin
Martyn Pearson13-Jan-03 3:19
Martyn Pearson13-Jan-03 3:19 
GeneralRe: Discovering DLLs Functions and Parameters Pin
Anonymous14-Jan-03 3:46
Anonymous14-Jan-03 3:46 
GeneralRe: Re Discovering DLLs Functions and Parameters Pin
Anonymous14-Jan-03 3:55
Anonymous14-Jan-03 3:55 
QuestionAny ideas? Pin
Joshua Nussbaum12-Jan-03 19:21
Joshua Nussbaum12-Jan-03 19:21 
AnswerRe: Any ideas? Pin
Moak12-Jan-03 19:37
Moak12-Jan-03 19:37 
AnswerRe: Any ideas? Pin
Nitron13-Jan-03 3:38
Nitron13-Jan-03 3:38 

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.