Looking at the Windows SDK, I found this #define directive for MAKEINTRESOURCEW:
#define MAKEINTRESOURCEW(i) ((LPWSTR)((ULONG_PTR)((WORD)(i))))
Can someone explain to me what this means? For example, what will be the value of MAKEINTRESOURCEW (0)? (1)? (-1)?
The result of this macro will be a pointer to a long string with a value equal to the given parameter. You can see this by reading the output of the precompiler (see / P C ++ Compiler Options). All casting is required to compile this macro result when the W [W] WSTR pointer is required, both in Win32 and x64 configurations.
API Windows, LoadIcon, . , , , , ( C). , WORD .
, int , , . int , , . , , ULONG_PTR "ULONG POINTER", - , , . 64- , :
ULONG_PTR
#define MAKEINTRESOURCE(i) (LPTSTR) ((DWORD) ((WORD) (i)))
ULONG_PTR, 32- 32- 64- 64- .
, , unsigned long, .
, " ".
: Windows 3.0 . , , . , , , , (, "" ).
" ", LPCTSTR ( ), .
Another example from the Windows API: a pointer to a window procedure. Each window has a window procedure (accessed GetWindowLongwith a flag GWL_WNDPROC. However, sometimes itβs just an integer that indicates what the βviewβ of the window is. Then there is a CallWindowProcthat knows to distinguish between these cases.
GetWindowLong
GWL_WNDPROC
CallWindowProc
Source: https://habr.com/ru/post/1748279/More articles:Communication between PHP and SQL server using new WAMP approaches - sqlHow to add a bubble counter on tabs in an android app? - androidLoop loop problem for Iqueyable - c #GAE: ValueError: unsafe ink brine - pythonEnter a comma after every 10 digits in Javascript? - javascript.NET Reflection Helper API? - reflectionBuilt-in scripting engine in .NET application - c #How to count the number of bytes read by TextReader.ReadLine ()? - c #MySQL: INNER JOIN - sqlI need help optimizing my database schema - optimizationAll Articles