Click here to Skip to main content
16,008,942 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Code Snippet for verification of ISBN / UPC Pin
Sumit Kapoor27-May-04 3:30
Sumit Kapoor27-May-04 3:30 
GeneralRe: Code Snippet for verification of ISBN / UPC Pin
David Crow27-May-04 3:51
David Crow27-May-04 3:51 
GeneralRe: Code Snippet for verification of ISBN / UPC Pin
Sumit Kapoor27-May-04 4:40
Sumit Kapoor27-May-04 4:40 
QuestionDownload my .ocx that depends on 2 other dll’s? Pin
anderslundsgard27-May-04 1:42
anderslundsgard27-May-04 1:42 
GeneralThread, CString function and memory leak Pin
J.B.27-May-04 1:33
J.B.27-May-04 1:33 
GeneralRe: Thread, CString function and memory leak Pin
vikramlinux27-May-04 2:36
vikramlinux27-May-04 2:36 
GeneralRe: Thread, CString function and memory leak Pin
Antony M Kancidrowski27-May-04 3:01
Antony M Kancidrowski27-May-04 3:01 
GeneralRe: Thread, CString function and memory leak Pin
J.B.27-May-04 3:15
J.B.27-May-04 3:15 
Thanks vikrams for the reply,

I see what you are getting. I've always thought that CString is different to PCTSTR or char *. When a function is declared to have return value type CString, it gets its own memory allocation, instead of a pointer to some memory address. So when, in my case, resString goes out of scope upon the function return, the function value still is there (been copied over from resString), in its own space. I'm not sure if I'm right on this point, correct me if I'm wrong.

If I were wrong, I think this would only lead to the loss of data, instead of memory leak. I tried anyway, placing resString as a class member in .h file or as a global variable on the top of .cpp still gives memory leaks Frown | :(

Any more ideas?

BTW: the CMyDlg class is actually a child dialog of some main dialog. It is created in the main dialog's OnInitDialog()
<code>
	pMyDlg = new CMyDlg();
	pMyDlg->Create(IDD_MY_DIALOG, this);
	pMyDlg->ShowWindow(SW_SHOW);	// main dialog is shown by default

and destroyed in the main dialog's OnDestroy()
<code>
	pMyDlg->DestroyWindow();
	delete pMyDlg;

if that has something to do with it.

Thanks again.
GeneralRe: Thread, CString function and memory leak Pin
Antony M Kancidrowski27-May-04 2:58
Antony M Kancidrowski27-May-04 2:58 
GeneralRe: Thread, CString function and memory leak Pin
J.B.27-May-04 3:28
J.B.27-May-04 3:28 
GeneralRe: Thread, CString function and memory leak Pin
Antony M Kancidrowski27-May-04 3:41
Antony M Kancidrowski27-May-04 3:41 
GeneralRe: Thread, CString function and memory leak Pin
J.B.27-May-04 4:04
J.B.27-May-04 4:04 
GeneralRe: Thread, CString function and memory leak Pin
Antony M Kancidrowski27-May-04 22:50
Antony M Kancidrowski27-May-04 22:50 
GeneralRe: Thread, CString function and memory leak Pin
J.B.28-May-04 7:11
J.B.28-May-04 7:11 
Generalhtml based apps tuts Pin
kzyczynski27-May-04 1:27
kzyczynski27-May-04 1:27 
GeneralProblems with drawing straight lines Pin
lostris27-May-04 0:58
lostris27-May-04 0:58 
GeneralRe: Problems with drawing straight lines Pin
nguyenvhn27-May-04 1:27
nguyenvhn27-May-04 1:27 
GeneralRe: Problems with drawing straight lines Pin
lostris27-May-04 2:01
lostris27-May-04 2:01 
GeneralNetwork connected notification Pin
cheesepirate27-May-04 0:41
cheesepirate27-May-04 0:41 
GeneralRe: Network connected notification Pin
David Crow27-May-04 3:10
David Crow27-May-04 3:10 
GeneralI need a method to find out All paths from a node( such as I) to another node (Such as J) in a digraph. the digraph is represented by adjacency matrix! Pin
ymq832827-May-04 0:01
ymq832827-May-04 0:01 
GeneralRe: I need a method to find out All paths from a node( such as I) to another node (Such as J) in a digraph. the digraph is represented by adjacency matrix! Pin
Garth J Lancaster27-May-04 1:07
professionalGarth J Lancaster27-May-04 1:07 
GeneralRe: I need a method to find out All paths from a node( such as I) to another node (Such as J) in a digraph. the digraph is represented by adjacency matrix! Pin
David Crow27-May-04 3:22
David Crow27-May-04 3:22 
GeneralDLL Pin
Poorniselva26-May-04 23:56
Poorniselva26-May-04 23:56 
GeneralRe: DLL Pin
vikramlinux27-May-04 2:40
vikramlinux27-May-04 2:40 

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.