hi guys new here and im a novie when it comes to C ++ done some visual basic before but its been so long. so anyway im trying to create a simple program that allows me to click onto the form and then it draws a coil design its simple really.
its a mfc, MDI if ive got that correct thats the way i setup the project when i created it.
the code is as follows
CODE
void Ccoils2View::OnLButtonDown(UINT nFlags,CPoint point)
{
CView::OnLButtonDown(nFlags, point);
CDC * pDC=GetDC();
Ccoils2DOC* pDoc= GetDocument ();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
//The bit i get stuck around is here;
int angle,x,y,z;
x=20;
y=0;
z=0;
for(angle=0; angle<90; angle++)
{
z=z++;
pDC->MoveTo(x+100+angle,y+100);
y=20*sin(angle*6.28/30);
x=20*cos(angle*6.28/30);
pDC->LineTo(x+100+angle,y+z+100);
}
}
ok so im stuck being that i have to manually enter the 1st x and y co ordinate at the beginning where i would like to click somewhere on the screen and then grab that co-ordinate and place it into the formula and draw from that point.
i hope this helps and makes any sense to anybody out there and hopefully you could help
ive tried to do the following
CODE
int x=LOWORD(lParam);
int y=HIWORD(lParam);
and also
CODE
x=GET_X_LPARAM(lParam);
Y=GET_Y_LPARAM(lParam);
and it comes up with lParam undeclared identifier but how do i identify it as a interger at the beginning with x and y or somewhere else. it has been a long time since ive really done anything in programming and im very rusty and im very sorry if this sounds reaelly stupid question and easily answered but it would be a great help. thanks very much again and hope to get a answer
dan.