hbelusca@svn.reactos.org wrote:
+#define RC_STRING_MAX_SIZE 4096
WCHAR Format[RC_STRING_MAX_SIZE];
LPWSTR lpMsgBuf = NULL;
DWORD Len; va_list args;
if (!LoadStringW(GetModuleHandleW(NULL), id, Format,
_countof(Format)))
Now instead of
#define RC_STRING_MAX_SIZE 4096 WCHAR Format[RC_STRING_MAX_SIZE]; LoadStringW(GetModuleHandleW(NULL), id, Format, _countof(Format));
just do a
LPWSTR lpFormatBuf; LoadStringW(GetModuleHandleW(NULL), id, (LPWSTR)&lpFormatBuf, 0);
and you have a perfect universal solution for any resource string length without caring about buffer sizes at all. It doesn't even need any extra memory :) This should actually be changed in a lot of places!
- Colin