Click here to Skip to main content
16,011,947 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Multi Monitor and StretchDIBits Pin
Blake Miller22-Feb-05 6:34
Blake Miller22-Feb-05 6:34 
GeneralRe: Multi Monitor and StretchDIBits Pin
Jay Carter22-Feb-05 22:45
Jay Carter22-Feb-05 22:45 
Generaltitle bar color Pin
wasife21-Feb-05 23:54
wasife21-Feb-05 23:54 
GeneralRe: title bar color Pin
Muhammad Azam22-Feb-05 0:06
Muhammad Azam22-Feb-05 0:06 
GeneralRe: title bar color Pin
RChin22-Feb-05 0:22
RChin22-Feb-05 0:22 
GeneralRe: title bar color Pin
Roger Allen22-Feb-05 0:41
Roger Allen22-Feb-05 0:41 
GeneralLVITEM memory leak Pin
ralfeus21-Feb-05 23:36
ralfeus21-Feb-05 23:36 
GeneralRe: LVITEM memory leak Pin
RChin22-Feb-05 0:45
RChin22-Feb-05 0:45 
The pszText variable only requires the pointer to your displayed string. Because you are already storing the textual information in your document, you only need to set this variable to your string array.

Try this:
for (i = 0; i < pDoc->GetSize(); i++)
{
 CMovieData* pMovie = pDoc->GetMovie(i);

 LV_ITEM lvi;  
 lvi.mask = LVIF_TEXT | LVIF_PARAM;
 lvi.iItem = i;
 lvi.iSubItem = 0;
<font color=red> lvi.pszText = (LPCTSTR)pMovie->Name;</font>
 lvi.iImage = i;
 int pos = movList.InsertItem (&lvi);
 movList.SetItem(pos, 1, (LPCTSTR)pMovie->GetGenre());
}

[EDIT]
This will eliminate the need to create unmanaged memory allocation which resulted in your memory leaks.
[/EDIT]




I Dream of Absolute Zero

GeneralRe: LVITEM memory leak Pin
ralfeus22-Feb-05 2:25
ralfeus22-Feb-05 2:25 
GeneralRe: LVITEM memory leak Pin
RChin22-Feb-05 3:00
RChin22-Feb-05 3:00 
GeneralRe: LVITEM memory leak Pin
Tim Smith22-Feb-05 4:09
Tim Smith22-Feb-05 4:09 
Questionarabic in menu? Pin
Anonymous21-Feb-05 21:51
Anonymous21-Feb-05 21:51 
AnswerRe: arabic in menu? Pin
ThatsAlok21-Feb-05 22:14
ThatsAlok21-Feb-05 22:14 
GeneralIterate view Pin
Yulianto.21-Feb-05 19:23
Yulianto.21-Feb-05 19:23 
GeneralRe: Iterate view Pin
Blake Miller22-Feb-05 4:51
Blake Miller22-Feb-05 4:51 
GeneralRe: Iterate view Pin
Yulianto.22-Feb-05 14:26
Yulianto.22-Feb-05 14:26 
GeneralRe: Iterate view Pin
Blake Miller23-Feb-05 3:56
Blake Miller23-Feb-05 3:56 
GeneralRe: Iterate view Pin
Yulianto.23-Feb-05 14:49
Yulianto.23-Feb-05 14:49 
QuestionWhat are the differences between ordinary variables, references and pointer variables? Pin
jahfer21-Feb-05 19:13
jahfer21-Feb-05 19:13 
AnswerRe: What are the differences between ordinary variables, references and pointer variables? Pin
Ravi Bhavnani22-Feb-05 2:04
professionalRavi Bhavnani22-Feb-05 2:04 
GeneralTwo Dimensional Array using Vector Class Pin
OutlawTornNMT21-Feb-05 18:52
OutlawTornNMT21-Feb-05 18:52 
GeneralRe: Two Dimensional Array using Vector Class Pin
Kevin McFarlane22-Feb-05 2:14
Kevin McFarlane22-Feb-05 2:14 
GeneralRelease Handle Pin
SoftEngi21-Feb-05 18:37
SoftEngi21-Feb-05 18:37 
GeneralToolbar in ActiveX Control Pin
Anand for every one21-Feb-05 18:35
Anand for every one21-Feb-05 18:35 
GeneralRe: Toolbar in ActiveX Control Pin
jahfer21-Feb-05 19:29
jahfer21-Feb-05 19:29 

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.