According to MSDN, RECT and RECTL are identical structures. Is there any difference between them at all and if not whats the point of having both of them instead of just one?
There's no difference between them, as documented in the MSDN article. To understand why they both exist, you have to go back in history, back to Windows version 3 and earlier. Those were 16-bit versions of Windows, unlike the versions of Windows that everybody uses today. The Windows SDK version for Windows 3.1 declared the RECT structure like this, in windows.h:
typedef struct tagRECT
{
int left;
int top;
int right;
int bottom;
} RECT;
And the ole2.h header file declared RECTL using long for the structure elements. 16-bit C and C++ compilers back then implemented int as a 16-bit type, fitting the word size of a 16-bit processor, and implemented long as a 32-bit type.
32-bit compilers, as used in modern Windows versions, made int a 32-bit type, fitting the word size of a 32-bit processor. And kept long as a 32-bit type. Which made the difference between the two structure types disappear.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With