Click here to Skip to main content
15,893,588 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: XML to binary format Pin
mutpan8-Nov-11 21:54
mutpan8-Nov-11 21:54 
GeneralRe: XML to binary format Pin
Richard MacCutchan8-Nov-11 22:43
mveRichard MacCutchan8-Nov-11 22:43 
AnswerRe: XML to binary format Pin
Orjan Westin9-Nov-11 5:49
professionalOrjan Westin9-Nov-11 5:49 
AnswerRe: XML to binary format Pin
jschell9-Nov-11 11:05
jschell9-Nov-11 11:05 
QuestionText drawing in embedded system Pin
A_Fa8-Nov-11 4:10
A_Fa8-Nov-11 4:10 
AnswerRe: Text drawing in embedded system Pin
Orjan Westin9-Nov-11 6:16
professionalOrjan Westin9-Nov-11 6:16 
GeneralRe: Text drawing in embedded system Pin
A_Fa9-Nov-11 19:22
A_Fa9-Nov-11 19:22 
QuestionCListCtrl::InsertItem(...) - CImageList Pin
_Flaviu8-Nov-11 3:28
_Flaviu8-Nov-11 3:28 
I want to insert into a listview an item with an image :
C++
BOOL CTestListImageView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	cs.style |= LVS_REPORT;

	return CListView::PreCreateWindow(cs);
}


and

C++
void CTestListImageView::OnInitialUpdate()
{
	CListView::OnInitialUpdate();


	// TODO: You may populate your ListView with items by directly accessing
	//  its list control through a call to GetListCtrl().

	CListCtrl& ListCtrl = GetListCtrl();
	m_TraceImageList.Create(IDB_BITMAP_TRACEIL,16,1,ILC_MASK);
	ListCtrl.SetImageList(&m_TraceImageList,TVSIL_NORMAL);

	ListCtrl.InsertColumn(0, _T("Machine model"),LVCFMT_LEFT, 200);
	ListCtrl.InsertColumn(1, _T("Description"),	LVCFMT_LEFT, 250);

	int nIndex = ListCtrl.InsertItem(0, _T("Test"),2);
	ListCtrl.SetItemText(0,1, _T("aaaaaaaaaa"));
}


CTestListImageView class is derived from CLIstView, the m_TraceImageList data member is type of CImageList class, and have 10 images ...

still, the listview have not any image ( icon ) ... why ?
Why ? What I have do wrong ?

One mention : I prefer to insert an item with image with follow prototype :
C++
int InsertItem( int nItem, LPCTSTR lpszItem, int nImage );

not with
C++
int InsertItem( const LVITEM* pItem );

Thank you.
QuestionRe: CListCtrl::InsertItem(...) - CImageList Pin
David Crow8-Nov-11 4:01
David Crow8-Nov-11 4:01 
AnswerRe: CListCtrl::InsertItem(...) - CImageList Pin
_Flaviu8-Nov-11 19:42
_Flaviu8-Nov-11 19:42 
AnswerRe: CListCtrl::InsertItem(...) - CImageList Pin
Roger Allen9-Nov-11 1:36
Roger Allen9-Nov-11 1:36 
AnswerRe: CListCtrl::InsertItem(...) - CImageList Pin
Roger Allen9-Nov-11 1:38
Roger Allen9-Nov-11 1:38 
GeneralRe: CListCtrl::InsertItem(...) - CImageList Pin
_Flaviu9-Nov-11 6:16
_Flaviu9-Nov-11 6:16 
QuestionAlways on top (modeless) dialog box Pin
Hadi Dayvary8-Nov-11 1:42
professionalHadi Dayvary8-Nov-11 1:42 
QuestionRe: Always on top (modeless) dialog box Pin
David Crow8-Nov-11 2:59
David Crow8-Nov-11 2:59 
AnswerRe: Always on top (modeless) dialog box Pin
Hadi Dayvary8-Nov-11 4:05
professionalHadi Dayvary8-Nov-11 4:05 
QuestionRe: Always on top (modeless) dialog box Pin
David Crow8-Nov-11 4:40
David Crow8-Nov-11 4:40 
AnswerRe: Always on top (modeless) dialog box Pin
Hadi Dayvary8-Nov-11 7:03
professionalHadi Dayvary8-Nov-11 7:03 
GeneralRe: Always on top (modeless) dialog box Pin
David Crow8-Nov-11 8:43
David Crow8-Nov-11 8:43 
GeneralRe: Always on top (modeless) dialog box Pin
Hadi Dayvary8-Nov-11 19:40
professionalHadi Dayvary8-Nov-11 19:40 
AnswerRe: Always on top (modeless) dialog box Pin
basementman8-Nov-11 4:37
basementman8-Nov-11 4:37 
GeneralRe: Always on top (modeless) dialog box Pin
Hadi Dayvary8-Nov-11 7:06
professionalHadi Dayvary8-Nov-11 7:06 
QuestionCalling DLL methods related problem Pin
Member 83440907-Nov-11 19:31
Member 83440907-Nov-11 19:31 
AnswerRe: Calling DLL methods related problem Pin
Richard MacCutchan7-Nov-11 22:38
mveRichard MacCutchan7-Nov-11 22:38 
Questionreturning std::pair<> Pin
User 5838527-Nov-11 17:47
User 5838527-Nov-11 17:47 

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.