Loadstring () function usage tips

Source: Internet
Author: User

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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.