So I've been trying to undersatand why do I put WPARAM and LPARAM when I'm making a C++ window application and I couldn't understand why. Can someone help me with that?
Asked
Active
Viewed 46 times
0
-
1Because the winapi is ancient, from a time computers where still 16 bit and C++ hadn't been invented yet. So the designers back then defined WPARAM, LPARAM so they could change the integer types from 16 to 32 bit later. What you should do is write standard C++ as long as you can, and have a small layer between C++ and the WINAPI that does all conversion closest to the winapi code. If possible don't use the winapi at all and certainly not for threads, file handling etc. – Pepijn Kramer Jan 04 '23 at 15:52
-
3I recommend **Programming Windows** by Charles Petzold. Also see: https://stackoverflow.com/q/6339793/4641116 – Eljay Jan 04 '23 at 15:52
-
Forty years of history based on bad design. Just live with it. :-( – Pete Becker Jan 04 '23 at 16:20