|
Hamid. wrote: Maybe you have the special compiler that it can understands!
Shhhhhhhhhhhh!... Don't make they know.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
wat was that ????
|
|
|
|
|
Don't worry about. Just kidding with my old friend Hamid.
BTW try to start insertion from column 0 , as suggested by Jörgen Sigvardsson.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
My bet is that because you inserted a new column at 1, an empty zero width column was created at column 0. The inserted item is there, but it's in the 0th column, which you can't see. Try inserting columns from index 0 instead!
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
Jörgen Sigvardsson wrote: Try inserting columns from index 0 instead
Or add SubItems. Good bet indeed.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
<br />
m_users.InsertColumn(0,"a",LVCFMT_CENTER,150,0);<br />
m_users.InsertColumn(1,"b",LVCFMT_CENTER,50,0);<br />
m_users.InsertColumn(2,"c",LVCFMT_CENTER,150,0);<br />
m_users.InsertColumn(3,"d",LVCFMT_CENTER,150,0);<br />
<br />
LVITEM lvi;<br />
lvi.mask=LVIF_TEXT | LVIF_NORECOMPUTE ;<br />
lvi.iItem = 1;<br />
lvi.iSubItem = 0;<br />
lvi.pszText = _T("Hi");<br />
m_users.InsertItem(&lvi);<br />
on compilation & execution, still nothing on List !
Let me give you some more details, I might have done something wrong there...
I have used VC++ Wizard to create my project (i m new to vc++)
Then I added List control to a Dialog box
Then changed its properties to ->Report
Then created a m_users variable
Then I have inserted 4 columns to it
Everything works fine till here...
Now I try to add some data to it, & nothing happens on the list !
plz friends, guide me in this....
|
|
|
|
|
Were you cheating about the effective overload of the InsertItem method called?
Anyway:
Some suggestions:
(1) Change
tina- wrote: m_users.InsertColumn(0,"a",LVCFMT_CENTER,150,0);
m_users.InsertColumn(1,"b",LVCFMT_CENTER,50,0);
m_users.InsertColumn(2,"c",LVCFMT_CENTER,150,0);
m_users.InsertColumn(3,"d",LVCFMT_CENTER,150,0);
To
m_users.InsertColumn(0,"a",LVCFMT_CENTER,150,0);
m_users.InsertColumn(1,"b",LVCFMT_CENTER,50,1);
m_users.InsertColumn(2,"c",LVCFMT_CENTER,150,2);
m_users.InsertColumn(3,"d",LVCFMT_CENTER,150,3);
(2) Change
tina- wrote: lvi.iItem = 1;
To
lvi.iItem = 0;
(3) Add, before calling InsertItem method
lvi.cchTextMax = _tcslen(_T("Hi"));
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Thanx for your reply, but I made the changes & its still not working !
|
|
|
|
|
Try to further populate the List, for instance, add
BOOL fSuccess;
INT nItem;
fSuccess = m_users.SetItemText(0,1,_T("foo1");
fSuccess = m_users.SetItemText(0,2,_T("foo2");
fSuccess = m_users.SetItemText(0,3,_T("foo3");
nItem = m_users.InsertItem( 1, _T("boo"));
fSuccess = m_users.SetItemText(1,1,_T("boo1");
fSuccess = m_users.SetItemText(1,2,_T("boo2");
fSuccess = m_users.SetItemText(1,3,_T("boo3");
Checking always, with the debugger, the return values.
My resources are near to end...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
i tried to insert ur code,
<br />
<blockquote class="FQ"><div class="FQA"> CPallini wrote:</div>BOOL fSuccess;<br />
INT nItem;<br />
fSuccess = m_users.SetItemText(0,1,_T("foo1"));<br />
fSuccess = m_users.SetItemText(0,2,_T("foo2"));<br />
fSuccess = m_users.SetItemText(0,3,_T("foo3"));<br />
nItem = m_users.InsertItem( 1, _T("boo"));<br />
fSuccess = m_users.SetItemText(1,1,_T("boo1"));<br />
fSuccess = m_users.SetItemText(1,2,_T("boo2"));<br />
fSuccess = m_users.SetItemText(1,3,_T("boo3"));</blockquote><br />
<br />
but its giving exception !!!
|
|
|
|
|
Then exception info maybe useful. Please post it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
it says
0x80000003 exception occurred ...
|
|
|
|
|
|
Hamid. wrote: Did you see my links?
yeah, i checked ur links.
the code is working very well there, but not in my project!
wat shall i do ???
|
|
|
|
|
Why they didnt work?did you get any error?
|
|
|
|
|
CPallini wrote: Were you cheating about the effective overload of the InsertItem method called?
i didn't get u ...
|
|
|
|
|
Oh, don't worry about. It doesn't matter.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Thanx friends, its working now....
Thank you very much !!!
|
|
|
|
|
I add an accelerator and rebuild all, it doesn't take effect.
Then I modify the exist Ctrl+O to Ctrl+D and rebuild all, it doesn't take effect edither. Ctrl+O still works.
What the matter?
|
|
|
|
|
|
I add:
LoadAccelerators(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME));
It still doesn't work.
|
|
|
|
|
followait wrote: LoadAccelerators(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME));
Does the call succeed?
Maxwell Chen
|
|
|
|
|
Yes, the return value is not NULL.
|
|
|
|
|
solved
BCG put some an entry about accelerator in the registry, I delete it, after it add it again, it works as expected.
|
|
|
|
|
I rebooted my computer, no flicking now...
It's a program using GDI+, it doesn't flick yesterday, but it flicks now, even worse, it causes other irrelevant programs' windows flicking.
I installed sql server 2000 before I found it flicked again.
BTW, I always call Invalidate(FALSE) or InvalidateRect(&rc,FALSE) in the program.
Here is the code in OnDraw :
Graphics g(pDC->m_hDC);
g.SetTransform(&m_Matrix);
g.DrawImage(m_pMemImage,0,0);
g.ResetTransform();
if (m_pCtrlBoxMoving) {
DrawCtrlBoxFrame(m_pCtrlBoxMoving,&g);
} else if (m_pCtrlBoxSizing) {
DrawCtrlBoxFrame(m_pCtrlBoxSizing,&g);
} else if (m_pCtrlBoxRotating) {
DrawCtrlBoxFrame(m_pCtrlBoxRotating,&g);
}
modified on Saturday, January 12, 2008 2:55:40 AM
|
|
|
|
|