|
Hi stuart,
No the line is getting erasing.... i did the same thing whatever u have posted in the previous thread..
when i move vertical scroll bar down , the line is getting erasing..
For your information i have added that code in OnPaint function..
can you please tell me where i am doing wrong..?
thanks in advance..
modified on Thursday, February 19, 2009 1:23 PM
|
|
|
|
|
No idea - I implemented a line drawing thing, it worked fine.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi Stuart,
I am using below code snippet :
GetClientRect( &deflatedClientRect );
deflatedClientRect.DeflateRect( TB_WIDTH, TB_WIDTH );
slider_bar1.GetThumbRect( &thumbRect1);
slider_bar1.ClientToScreen( &thumbRect1);
ScreenToClient(&thumbRect1);
m_bottom_slider_control.GetThumbRect(&thumbRect2);
m_bottom_slider_control.ClientToScreen(&thumbRect2);
ScreenToClient(&thumbRect2);
ptStart.x = thumbRect1.CenterPoint().x;
ptStart.y = thumbRect1.bottom;
ptEnd.x = thumbRect2.CenterPoint().x;
ptEnd.y = thumbRect2.bottom;
x1 = ptStart.x; y1 = ptStart.y; x2 = ptEnd.x; y2 = ptEnd.y;
int nOldmode=dc.SetROP2(R2_NOTXORPEN);
dc.MoveTo(old_x1,old_y1);
dc.LineTo(old_x2,old_y2);
dc.MoveTo(x1,y1);
dc.LineTo(x2,y2);
old_x1 = x1;
old_y1 = y1;
old_x2 = x2;
old_y2 = y2;
I am writing below code in OnPaint function, when i moved vertical scroll bar down it is getting erasing ..
please tell me where i am going wrong..?
thanks in advance...
|
|
|
|
|
Don't know - can't see anything wrong with that.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
r u able to keep the line while verical bar moving.. with your code...? if so can you please send me the code total code snippet, so that i can get some thing..
|
|
|
|
|
Can't right now - the code's at work, I'm not, but I'll post it when I'm at work.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
OK thanks stuart i will be waiting for your response.
|
|
|
|
|
Here's the entirety of my OnPaint code. image1_ and image2_ are both member variables of type CImage . baseSize_ (also a member variable) is the initial size of the dialog. offset_ (also a member variable) is a CPoint holding the offset from the top-left point of the area on which I draw to the top-left of the visible area (i.e. the offset due to scrolling). slider_ is a member variable of type CSliderCtrl .
PAINTSTRUCT ps;
CDC* paintDC = BeginPaint(&ps);
CRect rcImage1(baseSize_);
rcImage1.bottom /= 2;
CRect rcImage2;
rcImage2.SubtractRect(baseSize_, rcImage1);
rcImage1.right -=100;
rcImage2.right -=100;
rcImage1.OffsetRect(-offset_);
rcImage2.OffsetRect(-offset_);
image1_.StretchBlt(*paintDC, rcImage1, SRCCOPY);
image2_.StretchBlt(*paintDC, rcImage2, SRCCOPY);
CPen redPen(PS_SOLID|PS_GEOMETRIC, 2, RGB(0xff, 0, 0));
CPen* oldPen = paintDC->SelectObject(&redPen);
CRect rcThumb;
slider_.GetThumbRect(&rcThumb);
slider_.MapWindowPoints(this, &rcThumb);
CPoint start(rcThumb.CenterPoint().x, rcThumb.bottom);
CPoint end(rcThumb.CenterPoint().x, rcImage2.bottom);
paintDC->MoveTo(start);
paintDC->LineTo(end);
paintDC->SelectObject(oldPen);
EndPaint(&ps);
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi Start,
based on your code snippet i came to know that i did small mistake in my code..., now i am able to get that.. but when i move scroll down the previous line is not getting erasing.. the previous line is still appearing..,
and one more thing.. when i move vertical bar scroll very down, then the line is also getting drawing on entire window..
Can you please help me regarding this..?
Thanks in advance..
|
|
|
|
|
Hi Stuart,
I got strucked in one place, for further move i need your help.
I am able to draw line in between two sliders with the help of your code, that's fine it is working fine. But when i move vertical scroll bar down I am getting the values of thubmRect are negative values.
So i am getting start and end points are also negative values.
that's the reason it is not able to erase previous line when i move vertical scroll bar down.
Can you please help me regarding this..?
Thanks in advance..
Your help will be appriciated..........
|
|
|
|
|
Well - negative co-ordinates say to me that the slider whose thumb you're retrieving the position of is outside the parent window's client area. That implies either that a) the line you're trying to erases is not in a visible area of the screen, or b) you're doing your calculations incorrectly.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
OnVScroll function i have written the following code snippet.
SCROLLINFO si = { sizeof(si), 0 };
GetScrollInfo(SB_VERT, &si, SIF_ALL);
CPoint newOffset(offset_);
switch (nSBCode)
{
case SB_LINEDOWN:
newOffset.y += si.nPage / 10;
break;
case SB_LINEUP:
newOffset.y -= si.nPage / 10;
break;
case SB_PAGEDOWN:
newOffset.y += si.nPage;
break;
case SB_THUMBTRACK:
case SB_THUMBPOSITION:
{
newOffset.y = nPos;
break;
}
case SB_PAGEUP:
{
newOffset.y -= si.nPage;
}
break;
default:
return;
}
LogMessage(__FILE__,__LINE__,TRACE_LOG_LEVEL,"VSroll bar clicked");
CRect currSize;
GetClientRect(&currSize);
const int maxOffset = baseSize_.Height() - currSize.Height();
newOffset.y = max(min(newOffset.y, maxOffset), 0);
SetScrollPos(SB_VERT,newOffset.y,TRUE);
ScrollWindow(0,offset_.y-newOffset.y);
offset_ = newOffset;
LogMessage(__FILE__,__LINE__,TRACE_LOG_LEVEL,"x = %d, y = %d",newOffset.x,newOffset.y);
CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
And From OnTimer Function i am calling DrawLine function, that function contains the following code snippet:
CRect rect;
GetClientRect(&rect);
slider_bar1.GetThumbRect(&rcThumb1);
slider_bar1.MapWindowPoints(this, &rcThumb1);
m_bottom_slider_control.GetThumbRect(&rcThumb2);
m_bottom_slider_control.MapWindowPoints(this, &rcThumb2);
start.x = rcThumb1.CenterPoint().x;
start.y = rcThumb1.bottom;
if (start.y<0)
{
start.y = 0;
}
end.x = rcThumb1.CenterPoint().x;
end.y = rcThumb2.bottom;
if (end.y > rect.Height())
{
end.y = rect.Height();
}
CRect rc;
rc.left = start.x-10;
if (start.y >= 10)
rc.top = start.y-10;
else
rc.top = 0;
rc.right = end.x+10;
rc.bottom = end.y+10;
And OnPaint Contains the following code snippet:
int nOldmode=dc.SetROP2(R2_NOTXORPEN);
dc.MoveTo(old_x1,old_y1);
dc.LineTo(old_x2,old_y2);
dc.MoveTo(start);
dc.LineTo(end);
old_x1 = start.x;
old_y1 = start.y;
old_x2 = end.x;
old_y2 = end.y;
Still i am getting negative values,
Can you please see the code and let me know where i am going wrong..?
Thanks in advance..
|
|
|
|
|
John502 wrote: Can you please see the code and let me know where i am going wrong
I don't know where your problem is.
I would advise you to get familiar with the debugger and step through the code to see what values variables are taking, so you can see which ones aren't what you expect.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
----------------------------------------------------------------------------------------------------
Hi Stuart, this is my debugging observation, even after seeing this info i am not getting any thing..
Can you please help me regarding this..?
14:55:46:106- Scroll Dialog init dialog function called
14:55:46:472- old_x1 = -842150451,old_y1 = -842150451,old_x2 = -842150451,old_y2 = -842150451
14:55:46:486- SetRop2 is called with nOldmode and return value is : 13
14:55:46:487- x1 = 37,y1 = 68,x2 = 37,y2 = 827
14:55:49:472- old_x1 = 37,old_y1 = 68,old_x2 = 37,old_y2 = 827
14:55:49:486- SetRop2 is called with nOldmode and return value is : 13
14:55:49:487- x1 = 38,y1 = 68,x2 = 38,y2 = 577
14:55:49:472- old_x1 = 38,old_y1 = 68,old_x2 = 38,old_y2 = 577
14:55:49:486- SetRop2 is called with nOldmode and return value is : 13
14:55:49:487- x1 = 39,y1 = 68,x2 = 39,y2 = 577
14:55:50:472- old_x1 = 39,old_y1 = 68,old_x2 = 39,old_y2 = 577
14:55:50:486- SetRop2 is called with nOldmode and return value is : 13
14:55:50:487- x1 = 40,y1 = 68,x2 = 40,y2 = 577
14:55:50:472- old_x1 = 40,old_y1 = 68,old_x2 = 40,old_y2 = 577
14:55:50:486- SetRop2 is called with nOldmode and return value is : 13
14:55:50:487- x1 = 156,y1 = 68,x2 = 156,y2 = 577
14:55:50:472- old_x1 = 156,old_y1 = 68,old_x2 = 156,old_y2 = 577
14:55:50:486- SetRop2 is called with nOldmode and return value is : 13
14:55:50:487- x1 = 156,y1 = 68,x2 = 156,y2 = 577
14:55:51:472- old_x1 = 156,old_y1 = 68,old_x2 = 156,old_y2 = 577
14:55:51:486- SetRop2 is called with nOldmode and return value is : 13
14:55:51:487- x1 = 157,y1 = 68,x2 = 157,y2 = 577
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 0
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 2
14:55:51:472- old_x1 = 157,old_y1 = 68,old_x2 = 157,old_y2 = 577
14:55:51:486- SetRop2 is called with nOldmode and return value is : 13
14:55:51:487- x1 = 157,y1 = 66,x2 = 157,y2 = 825
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 5
14:55:51:472- old_x1 = 157,old_y1 = 66,old_x2 = 157,old_y2 = 825
14:55:51:486- SetRop2 is called with nOldmode and return value is : 13
14:55:51:487- x1 = 157,y1 = 63,x2 = 157,y2 = 822
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 17
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 23
14:55:51:472- old_x1 = 157,old_y1 = 63,old_x2 = 157,old_y2 = 822
14:55:51:486- SetRop2 is called with nOldmode and return value is : 13
14:55:51:487- x1 = 157,y1 = 45,x2 = 157,y2 = 804
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 48
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 64
14:55:51:472- old_x1 = 157,old_y1 = 45,old_x2 = 157,old_y2 = 804
14:55:51:486- SetRop2 is called with nOldmode and return value is : 13
14:55:51:487- x1 = 157,y1 = 4,x2 = 157,y2 = 763
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 103
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 123
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 137
14:55:51:472- old_x1 = 157,old_y1 = 4,old_x2 = 157,old_y2 = 763
14:55:51:486- SetRop2 is called with nOldmode and return value is : 13
14:55:51:487- x1 = 157,y1 = 0,x2 = 157,y2 = 690
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 190
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 209
14:55:51:472- old_x1 = 157,old_y1 = 0,old_x2 = 157,old_y2 = 690
14:55:51:486- SetRop2 is called with nOldmode and return value is : 13
14:55:51:487- x1 = 157,y1 = 0,x2 = 157,y2 = 618
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 229
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 237
14:55:51:472- old_x1 = 157,old_y1 = 0,old_x2 = 157,old_y2 = 618
14:55:51:486- SetRop2 is called with nOldmode and return value is : 13
14:55:51:487- x1 = 157,y1 = 0,x2 = 157,y2 = 590
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 254
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 259
14:55:51:472- old_x1 = 157,old_y1 = 0,old_x2 = 157,old_y2 = 590
14:55:51:486- SetRop2 is called with nOldmode and return value is : 13
14:55:51:487- x1 = 157,y1 = 0,x2 = 157,y2 = 568
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 266
14:55:51:472- old_x1 = 157,old_y1 = 0,old_x2 = 157,old_y2 = 568
14:55:51:486- SetRop2 is called with nOldmode and return value is : 13
14:55:51:487- x1 = 157,y1 = 0,x2 = 157,y2 = 561
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 268
14:55:51:472- old_x1 = 157,old_y1 = 0,old_x2 = 157,old_y2 = 561
14:55:51:486- SetRop2 is called with nOldmode and return value is : 13
14:55:51:487- x1 = 157,y1 = 0,x2 = 157,y2 = 559
14:55:51:472- old_x1 = 157,old_y1 = 0,old_x2 = 157,old_y2 = 559
14:55:51:486- SetRop2 is called with nOldmode and return value is : 13
14:55:51:487- x1 = 158,y1 = 0,x2 = 158,y2 = 559
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 263
14:55:51:210- VSroll bar clicked
14:55:51:220- x = 0, y = 263
14:55:51:472- old_x1 = 158,old_y1 = 0,old_x2 = 158,old_y2 = 559
14:55:51:486- SetRop2 is called with nOldmode and return value is : 13
14:55:51:487- x1 = 158,y1 = 0,x2 = 158,y2 = 564
14:55:52:472- old_x1 = 158,old_y1 = 0,old_x2 = 158,old_y2 = 564
14:55:52:486- SetRop2 is called with nOldmode and return value is : 13
14:55:52:487- x1 = 159,y1 = 0,x2 = 159,y2 = 564
|
|
|
|
|
The only negative numbers I see are at the start - that screams 'uninitialised data' to me.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Sorry earlier i sent the log after i have added some code which weren't help me...
Please check the below log and let me know where i am going wrong..?
16:41:12:106- Scroll Dialog init dialog function called
16:41:12:480- old_x1 = -842150451,old_y1 = -842150451,old_x2 = -842150451,old_y2 = -842150451
16:41:12:494- SetRop2 is called with nOldmode and return value is : 13
16:41:12:495- x1 = 37,y1 = 68,x2 = 37,y2 = 827
16:41:15:480- old_x1 = 37,old_y1 = 68,old_x2 = 37,old_y2 = 827
16:41:15:494- SetRop2 is called with nOldmode and return value is : 13
16:41:15:495- x1 = 153,y1 = 68,x2 = 153,y2 = 827
16:41:15:480- old_x1 = 153,old_y1 = 68,old_x2 = 153,old_y2 = 827
16:41:15:494- SetRop2 is called with nOldmode and return value is : 13
16:41:15:495- x1 = 153,y1 = 68,x2 = 153,y2 = 827
16:41:15:480- old_x1 = 153,old_y1 = 68,old_x2 = 153,old_y2 = 827
16:41:15:494- SetRop2 is called with nOldmode and return value is : 13
16:41:15:495- x1 = 153,y1 = 68,x2 = 153,y2 = 827
16:41:16:480- old_x1 = 153,old_y1 = 68,old_x2 = 153,old_y2 = 827
16:41:16:494- SetRop2 is called with nOldmode and return value is : 13
16:41:16:495- x1 = 155,y1 = 68,x2 = 155,y2 = 827
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 0
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 3
16:41:16:480- old_x1 = 155,old_y1 = 68,old_x2 = 155,old_y2 = 827
16:41:16:494- SetRop2 is called with nOldmode and return value is : 13
16:41:16:495- x1 = 155,y1 = 65,x2 = 155,y2 = 824
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 11
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 12
16:41:16:480- old_x1 = 155,old_y1 = 65,old_x2 = 155,old_y2 = 824
16:41:16:494- SetRop2 is called with nOldmode and return value is : 13
16:41:16:495- x1 = 155,y1 = 56,x2 = 155,y2 = 815
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 31
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 39
16:41:16:480- old_x1 = 155,old_y1 = 56,old_x2 = 155,old_y2 = 815
16:41:16:494- SetRop2 is called with nOldmode and return value is : 13
16:41:16:495- x1 = 155,y1 = 29,x2 = 155,y2 = 788
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 70
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 78
16:41:16:480- old_x1 = 155,old_y1 = 29,old_x2 = 155,old_y2 = 788
16:41:16:494- SetRop2 is called with nOldmode and return value is : 13
16:41:16:495- x1 = 155,y1 = -10,x2 = 155,y2 = 749
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 121
16:41:16:480- old_x1 = 155,old_y1 = -10,old_x2 = 155,old_y2 = 749
16:41:16:494- SetRop2 is called with nOldmode and return value is : 13
16:41:16:495- x1 = 155,y1 = -53,x2 = 155,y2 = 706
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 159
16:41:16:480- old_x1 = 155,old_y1 = -53,old_x2 = 155,old_y2 = 706
16:41:16:494- SetRop2 is called with nOldmode and return value is : 13
16:41:16:495- x1 = 155,y1 = -91,x2 = 155,y2 = 668
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 182
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 193
16:41:16:480- old_x1 = 155,old_y1 = -91,old_x2 = 155,old_y2 = 668
16:41:16:494- SetRop2 is called with nOldmode and return value is : 13
16:41:16:495- x1 = 155,y1 = -125,x2 = 155,y2 = 634
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 215
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 218
16:41:16:480- old_x1 = 155,old_y1 = -125,old_x2 = 155,old_y2 = 634
16:41:16:494- SetRop2 is called with nOldmode and return value is : 13
16:41:16:495- x1 = 155,y1 = -150,x2 = 155,y2 = 609
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 235
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 237
16:41:16:480- old_x1 = 155,old_y1 = -150,old_x2 = 155,old_y2 = 609
16:41:16:494- SetRop2 is called with nOldmode and return value is : 13
16:41:16:495- x1 = 155,y1 = -169,x2 = 155,y2 = 590
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 248
16:41:16:480- old_x1 = 155,old_y1 = -169,old_x2 = 155,old_y2 = 590
16:41:16:494- SetRop2 is called with nOldmode and return value is : 13
16:41:16:495- x1 = 155,y1 = -180,x2 = 155,y2 = 579
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 254
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 255
16:41:16:480- old_x1 = 155,old_y1 = -180,old_x2 = 155,old_y2 = 579
16:41:16:494- SetRop2 is called with nOldmode and return value is : 13
16:41:16:495- x1 = 155,y1 = -187,x2 = 155,y2 = 572
16:41:16:210- VSroll bar clicked
16:41:16:220- x = 0, y = 260
16:41:17:480- old_x1 = 155,old_y1 = -187,old_x2 = 155,old_y2 = 572
16:41:17:494- SetRop2 is called with nOldmode and return value is : 13
16:41:17:495- x1 = 155,y1 = -192,x2 = 155,y2 = 567
16:41:17:210- VSroll bar clicked
16:41:17:220- x = 0, y = 265
16:41:17:480- old_x1 = 155,old_y1 = -192,old_x2 = 155,old_y2 = 567
16:41:17:494- SetRop2 is called with nOldmode and return value is : 13
16:41:17:495- x1 = 155,y1 = -197,x2 = 155,y2 = 562
16:41:17:210- VSroll bar clicked
16:41:17:220- x = 0, y = 269
16:41:17:210- VSroll bar clicked
16:41:17:220- x = 0, y = 271
16:41:17:480- old_x1 = 155,old_y1 = -197,old_x2 = 155,old_y2 = 562
16:41:17:494- SetRop2 is called with nOldmode and return value is : 13
16:41:17:495- x1 = 155,y1 = -203,x2 = 155,y2 = 556
16:41:17:480- old_x1 = 155,old_y1 = -203,old_x2 = 155,old_y2 = 556
16:41:17:494- SetRop2 is called with nOldmode and return value is : 13
16:41:17:495- x1 = 157,y1 = -203,x2 = 157,y2 = 556
16:41:17:210- VSroll bar clicked
16:41:17:220- x = 0, y = 271
16:41:17:480- old_x1 = 157,old_y1 = -203,old_x2 = 157,old_y2 = 556
16:41:17:494- SetRop2 is called with nOldmode and return value is : 13
16:41:17:495- x1 = 158,y1 = -203,x2 = 158,y2 = 556
16:41:17:210- VSroll bar clicked
16:41:17:220- x = 0, y = 271
16:41:18:480- old_x1 = 158,old_y1 = -203,old_x2 = 158,old_y2 = 556
16:41:18:494- SetRop2 is called with nOldmode and return value is : 13
16:41:18:495- x1 = 159,y1 = -203,x2 = 159,y2 = 556
16:41:18:210- VSroll bar clicked
16:41:18:220- x = 0, y = 269
16:41:18:480- old_x1 = 159,old_y1 = -203,old_x2 = 159,old_y2 = 556
16:41:18:494- SetRop2 is called with nOldmode and return value is : 13
16:41:18:495- x1 = 159,y1 = -201,x2 = 159,y2 = 558
16:41:18:210- VSroll bar clicked
16:41:18:220- x = 0, y = 260
16:41:18:210- VSroll bar clicked
16:41:18:220- x = 0, y = 255
16:41:18:480- old_x1 = 159,old_y1 = -201,old_x2 = 159,old_y2 = 558
16:41:18:494- SetRop2 is called with nOldmode and return value is : 13
16:41:18:495- x1 = 159,y1 = -187,x2 = 159,y2 = 572
16:41:18:210- VSroll bar clicked
16:41:18:220- x = 0, y = 234
16:41:18:210- VSroll bar clicked
16:41:18:220- x = 0, y = 221
16:41:18:480- old_x1 = 159,old_y1 = -187,old_x2 = 159,old_y2 = 572
16:41:18:494- SetRop2 is called with nOldmode and return value is : 13
16:41:18:495- x1 = 159,y1 = -153,x2 = 159,y2 = 606
16:41:18:210- VSroll bar clicked
16:41:18:220- x = 0, y = 181
16:41:18:210- VSroll bar clicked
16:41:18:220- x = 0, y = 165
16:41:18:480- old_x1 = 159,old_y1 = -153,old_x2 = 159,old_y2 = 606
16:41:18:494- SetRop2 is called with nOldmode and return value is : 13
16:41:18:495- x1 = 159,y1 = -97,x2 = 159,y2 = 662
16:41:18:210- VSroll bar clicked
16:41:18:220- x = 0, y = 92
16:41:18:480- old_x1 = 159,old_y1 = -97,old_x2 = 159,old_y2 = 662
16:41:18:494- SetRop2 is called with nOldmode and return value is : 13
16:41:18:495- x1 = 159,y1 = -24,x2 = 159,y2 = 735
16:41:18:210- VSroll bar clicked
16:41:18:220- x = 0, y = 25
16:41:18:480- old_x1 = 159,old_y1 = -24,old_x2 = 159,old_y2 = 735
16:41:18:494- SetRop2 is called with nOldmode and return value is : 13
16:41:18:495- x1 = 159,y1 = 43,x2 = 159,y2 = 802
16:41:18:210- VSroll bar clicked
16:41:18:220- x = 0, y = 0
16:41:18:480- old_x1 = 159,old_y1 = 43,old_x2 = 159,old_y2 = 802
16:41:18:494- SetRop2 is called with nOldmode and return value is : 13
16:41:18:495- x1 = 159,y1 = 68,x2 = 159,y2 = 827
16:41:18:210- VSroll bar clicked
16:41:18:220- x = 0, y = 0
16:41:18:480- old_x1 = 159,old_y1 = 68,old_x2 = 159,old_y2 = 827
16:41:18:494- SetRop2 is called with nOldmode and return value is : 13
16:41:18:495- x1 = 160,y1 = 68,x2 = 160,y2 = 827
16:41:19:480- old_x1 = 160,old_y1 = 68,old_x2 = 160,old_y2 = 827
16:41:19:494- SetRop2 is called with nOldmode and return value is : 13
16:41:19:495- x1 = 161,y1 = 68,x2 = 161,y2 = 827
16:41:19:480- old_x1 = 161,old_y1 = 68,old_x2 = 161,old_y2 = 827
16:41:19:494- SetRop2 is called with nOldmode and return value is : 13
16:41:19:495- x1 = 162,y1 = 68,x2 = 162,y2 = 827
|
|
|
|
|
The only thing I can think of is that the scroll-bar offset is changing between the time that you assign a value to old_x and the time you use it, so it doesn't refer to the same position on screen at both points in time.
Aside from that, I'm sorry - I really can't help.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks Stuart,
Thank you so much for your help on images and check boxes....
Thanks
Venkatesh
|
|
|
|
|
Hi all,
I am working on vs2005 (vc++8).
I have created one dll in vs2005(vc++8), in that we have one function which returns "std::string" .
when i load this dll in another vs2005(vc++8) application and call the function which returns "std::string",
we get following error:
Windows has triggered a breakpoint in vstestdll.exe.
This may be due to a corruption of the heap, and indicates a bug in vstestdll.exe or any of the DLLs it has loaded.
The output window may have more diagnostic information
For more detail code is as follows:
[code]
dll function :
std::string getDH1(int clo)
{
return std::string("abcdefghijklmnopqr");
}
.exe code:
#define TEST2_API __declspec(dllimport);
TEST2_API std::string getDH1(int clo);
int _tmain(int argc, _TCHAR* argv[])
{
string sam =getDH1(1);
return 0;
}
[/code]
|
|
|
|
|
Does your code use a static library version of the C runtime? If so, then this sort of error is quite likely, as the EXE and DLL have different C heaps, so when the std::string is destructed, the EXE is trying to free memory in the DLL's heap, which is bad.
Look in Project Properties, C/C++->Code Generation, Runtime Library option.
|
|
|
|
|
I hope I can express the question with my poor english.
I wanna write a dialog based program, and let user to set the time and at the given time, execute other programs(the user gives the exe file path).
Can give some code hint or source code like this?
Or a program in sourceforge having such function issue.
|
|
|
|
|
Why don't you use Windows 's Scheduled Tasks (see, for instance [^])?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I need implement this function in my program.
|
|
|
|
|
Well, you application may create enties for the windows scheduler, se, for instance [^].
It is IMHO the cleanest way.
[added]
Try also to use CodeProject 's article search engine [^], it's free...
[/added]
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Thursday, February 5, 2009 8:54 AM
|
|
|
|
|
Task scheduler[^]? That's the API behind Windows Scheduled Tasks. You're much better off using facilities built into the OS than coding an equivalent yourself.
|
|
|
|
|