my code goes as
1.I check if the pixel colour is different from bakground colour in onLbutton down function
by
if(GetPixel(hDC,point.x,point.y)==RGB(0,0,128))
{
busindex=pDoc->InBus (tempx ,tempy );
if(busindex>=0)
{SetCapture();m_dragging=TRUE;}
}
2.my InBus ftn checks as:
InBus
{
CBus1* bus;
bus=GetBus(index);
if( x>= bus->m_x1 && x<=abs(bus->m_x2 -bus->m_x1))
{
if( y>= bus->m_y1 && y<=abs(bus->m_y2 -bus->m_y1))
{
return index;
}
return -1;
}
getbus simply return a pointer 2 dat object in an array
this should return a index of object that has co-ordinates enclosing x,y
the problem is in 2 step it never goes in that if statements......
i cud not get it y??
1 reason i thought was of Mapping of co-ordinates....any ways pllzz think ........
thnx
sir agreed my code is not is according to proper tags and tagging it will take another some hour or so but if you can please help me out with this right now.....actually am in shortage of time...and have to submit the project.....sir co-ordinate and help me out...
hope you would co-operate and help me out
sir agreed my code is not is according to proper tags and tagging it will take another some hour or so but if you can please help me out with this right now.....actually am in shortage of time...and have to submit the project.....sir co-ordinate and help me out...
hope you would co-operate and help me out
It takes all of two or three seconds to post using code tags. You want help, but you won't take the time to follow the forum guidelines. Good luck with that strategy. You could have added tags and formatting in less time than it took to write that sarcastic reply.
It is impossible to help you since we have no idea what CBus1 is, how GetBus and GetNumBus look like and so on.
Try to debug you code step-by-step (set a break point into the CPflowDoc::InBus method) to see what happens, what values are returned by GetNumBus and GetBus, what coordinates are used to create CRect object and so on.
Besides, your code is wrong since it provides memory leaks: CRect objects are newed but never deleted!
BTW, why are creating them in the heap?
Bookmarks