Click here to Skip to main content
15,922,325 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: App is crashing when trying to restore Brushes and Fonts Pin
Terry O'Nolley25-Sep-03 11:06
Terry O'Nolley25-Sep-03 11:06 
QuestionConversion from DB_NUMERIC to double? Pin
Rene De La Garza25-Sep-03 9:50
Rene De La Garza25-Sep-03 9:50 
AnswerRe: Conversion from DB_NUMERIC to double? Pin
Steve S25-Sep-03 22:45
Steve S25-Sep-03 22:45 
Generalspeaker volume too low Pin
Binayak25-Sep-03 9:40
Binayak25-Sep-03 9:40 
GeneralRe: speaker volume too low Pin
David Crow25-Sep-03 9:45
David Crow25-Sep-03 9:45 
GeneralRe: speaker volume too low Pin
Binayak25-Sep-03 10:14
Binayak25-Sep-03 10:14 
GeneralRe: speaker volume too low Pin
David Crow25-Sep-03 10:19
David Crow25-Sep-03 10:19 
GeneralRe: speaker volume too low Pin
Binayak25-Sep-03 10:22
Binayak25-Sep-03 10:22 
GeneralRe: speaker volume too low Pin
David Crow25-Sep-03 10:25
David Crow25-Sep-03 10:25 
GeneralRe: speaker volume too low Pin
Binayak25-Sep-03 10:27
Binayak25-Sep-03 10:27 
GeneralRe: speaker volume too low Pin
David Crow25-Sep-03 10:31
David Crow25-Sep-03 10:31 
GeneralRe: speaker volume too low Pin
Alvaro Mendez25-Sep-03 11:05
Alvaro Mendez25-Sep-03 11:05 
GeneralRe: speaker volume too low Pin
Binayak25-Sep-03 11:06
Binayak25-Sep-03 11:06 
GeneralRe: speaker volume too low Pin
73Zeppelin26-Sep-03 6:12
73Zeppelin26-Sep-03 6:12 
QuestionOCX perhaps ??? Pin
The_Server25-Sep-03 9:36
The_Server25-Sep-03 9:36 
GeneralRe: MFC/W32 Bitmap/Icon editor in source... Pin
igor196025-Sep-03 9:13
igor196025-Sep-03 9:13 
GeneralRe: MFC/W32 Bitmap/Icon editor in source... Pin
Neville Franks25-Sep-03 11:26
Neville Franks25-Sep-03 11:26 
GeneralAutomated Testing tools for MFC / VC++ application Pin
Member 35909825-Sep-03 8:50
Member 35909825-Sep-03 8:50 
GeneralRe: Automated Testing tools for MFC / VC++ application Pin
David Crow25-Sep-03 8:52
David Crow25-Sep-03 8:52 
GeneralRe: Automated Testing tools for MFC / VC++ application Pin
Joe Woodbury25-Sep-03 18:20
professionalJoe Woodbury25-Sep-03 18:20 
GeneralCD Writing Pin
Member 45104625-Sep-03 8:25
Member 45104625-Sep-03 8:25 
GeneralRe: CD Writing Pin
David Crow25-Sep-03 8:51
David Crow25-Sep-03 8:51 
GeneralRe: CD Writing Pin
Alexander M.,27-Sep-03 12:00
Alexander M.,27-Sep-03 12:00 
GeneralQuestion about CListCtrl Pin
b_girl25-Sep-03 7:19
b_girl25-Sep-03 7:19 
I have a CListCtrl that I'm attempting to add items to. I have followed what it says to do for inserting items in the Using the List Control article by Matt Weagle: http://www.codeproject.com/listctrl/listctrldemo.asp?target=clistctrl%7Creport%7Cview%7Cinsert

I have created 2 columns that I'm attempting to add items to. The first row that I insert does go in the correct place, but when I insert the second row, the item in the first column gets entered into row 0 and the contents of the current row 0 get shifted down to row 1. This wouldn't be a huge problem for me, except that that I enter into the second column, doesn't get inserted into row 0, but goes into row 1, overwriting the current value in row 1. Here's my code so far, if anyone notices any mistakes, please let me know!

CString tempstr, strItem;
CStdioFile browseFile;
LVITEM lvi;
int numRead = browseFile.Read(readBuffer, fileLength);
....
int rowNumber = 0;
//read in/set z and concentration values in CListCtrl, use InsertItem
for (counter = 0; counter < numRead; counter++)
{
tempstr = "";
while((readBuffer[counter] != ' ') && (readBuffer[counter] != '\n') && (counter < numRead))
{
tempstr += readBuffer[counter];
counter++;
}
if(readBuffer[counter] == ' ')
{
//if a space, tempstr is for the first column
lvi.mask = LVIF_TEXT;
strItem.Format(_T(tempstr));
lvi.iItem = rowNumber;
lvi.iSubItem = 0;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
m_elementList.InsertItem(&lvi);
}
else if(readBuffer[counter] == '\n')
{
//if a newline, tempstr is for the second column
strItem.Format(_T(tempstr));
lvi.iSubItem = 1;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
m_elementList.SetItem(&lvi);
//increase the row number
rowNumber++;
}
else if(counter >= numRead)
{
//if the last element in the file, tempstr is for the second column
strItem.Format(_T(tempstr));
lvi.iSubItem = 1;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
m_elementList.SetItem(&lvi);
}
}
GeneralRe: Question about CListCtrl Pin
Michael Dunn25-Sep-03 7:32
sitebuilderMichael Dunn25-Sep-03 7:32 

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.