|
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
|
|
|
|
|
Hi, All
I overloaded CStatic::OnPaint()
<br />
class myStatic : public CStatic<br />
{<br />
...<br />
}<br />
<br />
void myStatic::OnPaint()<br />
{<br />
<br />
static bool bb = true;<br />
<br />
CPaintDC dc(this); <br />
CBitmap myBitmap; <br />
<br />
if (bb)<br />
{<br />
bb = false;<br />
}<br />
else<br />
{<br />
bb = true;<br />
}<br />
<br />
}<br />
<br />
I definition a myStatic object in main dialog
<br />
class CMyDialog : public CDialog<br />
{<br />
private:<br />
myStatic m_picture;<br />
void changePicture();<br />
}<br />
<br />
void CMyDialog::changePicture()<br />
{<br />
m_picture.SendMessage(WM_PAINT,0,0);<br />
this->SendMessage(WM_PAINT,0,0);<br />
}<br />
When run to changePicture(), can run to print (1.BMP or 2.BMP) , but the picture not real changed.
And then, if the main dialog had changed, the picture was real changed.
So, how can make the picture is real change at changePicture() is run.
|
|
|
|
|
WM_PAINT tells a window to redraw its invalid area,
so you should make the picture area invalid first using
InvalidateRect
or
Invalidate
|
|
|
|
|
Why you didnt use of like this code
void CdddDlg::OnBnClickedButton1()
{
CImage m;
m.Load(_T("c:\\1.jpg"));
m_MyStatic.SetBitmap(m.Detach());
void CdddDlg::OnBnClickedButton2()
{
m.Load(_T("c:\\2.bmp"));
m_MyStatic.SetBitmap(m.Detach());
}
Do you need to derived of CStatic?
|
|
|
|
|
You CANNOT send WM_PAINT messages yourself. The system will send
WM_PAINT messages when a window or portion of a window needs repainting
and there's no other higher priority messages queued.
To mark a window for repainting, as followait suggested, use the Invalidate
functions. A WM_PAINT message will be sent to the window that is invalidated.
If you need an immediate repaint, you can follow the Invalidate call with a
call to UpdateWindow(), or combine the invalidate and update in one call to
RedrawWindow().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I have a list control, in that i am adding file path given by user in two ways :-
1) Single file
2) By Directory
I want that no same path files should be added in my control by either way.... I am not geting the way to implement it.
Can anybody help me in this.
Thanks in advance
|
|
|
|
|
Use FindItem of CListCtrl before adding the path to it to check if it already exists in the list.
|
|
|
|
|
You can use of FindItem,but how did you try that users to insert files to listctrl?
|
|
|
|
|