Loadstring () function usage tips:
The prototype declared by this function is int loadstring (hinstance, uint uid,
Lptstr lpbuffer, int cchbuffermax );
The third parameter is a pointer to the buffer that receives the load content,
When we only need to extract the string from the resource and do not need to change it, there is a backdoor available:
We set the parameter lpbuffer to null, so that the function will return a pointer, which is used as follows:
Shloaddibitmap (lpctstr) loadstring (g_hinst, filename [1], null, 0 ));
We can only reference but cannot change this string unless you apply for another memory to copy it.
# Include <WINBASE. h> when using this function, and add the-n option to the resource file compilation command line.
In vs2005, right-click the. RC file in Solution Explorer and open the properties page.
Configure properties-> resource-> Add the additional option "-n" to the command line"