What’s the deal with POINT and POINTL in the Win32 API?

0
4
Asked By CuriousCoder42 On

I was diving into the Win32 API documentation and I noticed that the POINT structure has a note saying it's identical to the POINTL structure. Can anyone explain why POINTL exists if it serves the same purpose as POINT?

9 Answers

Answered By On

c

Answered By On

I

Answered By On

r

Answered By CodeNinja88 On

Honestly, I can't say for sure, but I believe in the Win16 API, `POINT` was just an alias for the `POINTS` structure, not for `POINTL`. If you want long integers, go for `POINTL`, and if you’re looking for short integers, use `POINTS`. For general purposes, stick with `POINT`. Although, things were a lot simpler back in those days!

OldSchoolDev -

You’re right about that; back in the Win16 API, we only had `POINT`, and GDI was limited to a max of 32767x32767, so there wasn’t really any need for `POINTL` or `POINTS`. Those were simpler times!

Answered By On

C

Answered By DevGuy1990 On

I think the 'L' in `POINTL` stands for 'long'. The `POINT` structure likely had varying member data types in the past, which could change depending on the architecture. So, if you need long values, `POINTL` is your go-to!

Answered By On

a

Answered By TechSavvyDude On

The different widths in the `POINT` structure across various Windows versions are the reason behind the existence of `POINTL`. Back in the day, like on 16-bit Windows 3, the fields were 16-bit integers, but then they switched to 32-bit integers in 32-bit Windows. So, `POINTL` was introduced to use `LONG` types for consistency across different C implementations. This was important because the size of `int` could vary, causing potential compatibility issues in code. It's a bit messy, but it helps maintain support for older programs!

Answered By Aaron Garnes On

{

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.