Click here to Skip to main content
15,917,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.
I am getting memory leak while using the Format of the CString. Is it an issue of CString itself? Is there any alternative for removing the leaks?
Posted

1 solution

I have been using CString::Format very much and have never experienced any memory leak. Do you have any code sample to display what you are doing?
 
Share this answer
 
Comments
reshmi2000 13-Sep-10 1:26am    
My MFC code is not Unicode. I dont know whether that is the issue with me. The code part is shown below:-

CString csCmd;
csCmd.Format("SETMUSICINFOTYPE %d", 1);
Sulan 13-Sep-10 1:46am    
Strange. I have used that similar constructions a lot and never seen any memory leaks. Are you certain that it is the Format that gives the memory leak and not some other piece of code that is using that line?
reshmi2000 13-Sep-10 2:29am    
yes i am sure. When i remove the Format function, there are no memory leaks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900