Announcement

Collapse
No announcement yet.

MakePoints

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cliff Nichols
    replied
    I had not thought about choice of format.

    one of those "lil things" that could cause "Such Problems" later

    maybe LO should be match with LONG rather than DWORD so negative values match???

    Leave a comment:


  • Patrice Terrier
    replied
    Common mistake with mouse coordinates and control ID

    Leave a comment:


  • Dominic Mitchell
    replied
    Just do this
    Code:
    MACRO MAKEPOINTS(lParam, pt)
        pt.x = LOINT(lParam)
        pt.y = HIINT(lParam)
    END MACRO
    The result is the same.
    Why did you use loword?

    Leave a comment:


  • Michael Mattias
    replied
    Probably NOT an oversight...
    From Windef.h
    Code:
    typedef struct tagPOINTS
    {
    #ifndef _MAC
        SHORT   x;
        SHORT   y;
    #else
        SHORT   y;
        SHORT   x;
    #endif
    } POINTS, *PPOINTS, *LPPOINTS;

    from wingdi.h
    Code:
    #define MAKEPOINTS(l)       (*((POINTS FAR *)&(l)))
    I think your conversion is fine.

    Leave a comment:


  • José Roca
    replied
    It is not an oversight. It simply can't be translated because it returns an structure and neither PB macros nor PB functions can currently do it.

    Code:
    POINTS MAKEPOINTS(
        DWORD dwValue
    );
    You are using a workaround, not a straight conversion.

    Leave a comment:


  • Cliff Nichols
    started a topic MakePoints

    MakePoints

    Temporarily I am using
    Code:
    MACRO MAKEPOINTS(lParam, pt)
        pt.x = BITS%(LOWRD(lParam))
        pt.y = BITS%(HIWRD(lParam))
    END MACRO
    But since docs state for WM_MOUSEMOVE
    Remarks

    The MAKEPOINTS macro can be used to convert the lParam parameter to a POINTS structure.
    My compiler says MakePoints is undefined unless I use the macro above. So I have to ask if this is an oversight in the Win32Api.Inc file???? or am I missing an Inc that already has this macro??/
Working...
X