"Hans Leidekker" hans@it.vu.nl wrote:
But according MSDN:
The return value is a static pointer to the character string. Do not free this string.
How would you handle this using LoadString?
Something like this:
PCHAR ldap_err2stringA( ULONG err ) { static char buf[256];
if (!LoadStringA(wldap_hinst, err, buf, 256)) LoadStringA(wldap_hinst, IDS_DEFAULT_ERROR, buf, 256);
return buf; }
PWCHAR ldap_err2stringW( ULONG err ) { static WCHAR buf[256];
if (!LoadStringW(wldap_hinst, err, buf, 256)) LoadStringW(wldap_hinst, IDS_DEFAULT_ERROR, buf, 256);
return buf; }