I tried searching for something to help me on this but with no luck, so here goes my question. I am trying to pass a struct by reference (because it seems like the right thing to do) and I get no compilation errors however when the function gets called my app crashes immediately. Here is what I have.
Function Declaration
Function codePHP Code:
void drawline(POINT *, POINT *);
usagePHP Code:
void OSDC::drawline(POINT *pt1, POINT *pt2)
{
POINT pts[1];
pts[0] = *pt1;
pts[1] = *pt2;
Polyline(hDC, &pts[0], 2);
}
Thanks in advance.PHP Code:
POINT pt1, pt2;
pt1.x = 0; pt1.y = 0;
pt2.x = 10; pt2.y = 20;
o.setlinecolor(RGB(0, 15, 255));
o.drawline(&pt1, &pt2);




Reply With Quote