Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using POINT in a class.

0 views
Skip to first unread message

Nic

unread,
Jan 2, 2010, 2:39:20 PM1/2/10
to
For the following class:

class CPoint: public tagPOINT
{
public:
CPoint(LPARAM lParam)
{
x = GET_X_LPARAM(lParam);
y = GET_Y_LPARAM(lParam);
}
};

is it safe to use it as follows:

OnLButtonDown(&CPoint(lParam));

Thanks
Nic


Igor Tandetnik

unread,
Jan 3, 2010, 12:13:59 AM1/3/10
to

Looks OK to me, assuming OnLButtonDown doesn't try to save the pointer somewhere for later use. Any reason it takes a pointer and not a const reference?
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925

0 new messages