LPSTR_TEXTCALLBACK
Posted: Mon Nov 05, 2018 9:36 am
When trying to compile the GUI classes furnished by Vulcan with the new compiler I get for the following line
#define LPSTR_TEXTCALLBACK PSZ(_CAST, 0xFFFFFFFF)
the error
Error XS9068 The compiler generated an automatic conversion to PSZ. This may create a memory leak in your application. Please use String2Psz() to let the compiler manage the lifetime of the PSZ or use StringAlloc() and manage the lifetime of the PSZ yourself.
I ask me how to resolve this ugly piece of code, since it is a casting of a number into a string.
Looking to the original C code I can see that already there is the same ugly code:
#define LPSTR_TEXTCALLBACKW ((LPWSTR)-1)
Arne
#define LPSTR_TEXTCALLBACK PSZ(_CAST, 0xFFFFFFFF)
the error
Error XS9068 The compiler generated an automatic conversion to PSZ. This may create a memory leak in your application. Please use String2Psz() to let the compiler manage the lifetime of the PSZ or use StringAlloc() and manage the lifetime of the PSZ yourself.
I ask me how to resolve this ugly piece of code, since it is a casting of a number into a string.
Looking to the original C code I can see that already there is the same ugly code:
#define LPSTR_TEXTCALLBACKW ((LPWSTR)-1)
Arne