Module, instance, and image in Windows

Source: Internet
Author: User
When reading windows via C/C ++, we often see the words module, instance, and image. In fact, this is a term in windows. Module is equivalent to EXE and DLL files. In the process address space, both EXE and DLL are loaded as modules.

The hmodule and hinstance in windows have the same data structure. Their values are all an address, that is, the base address of the module. This is why all functions such as loadicon and LoadImage require an hmodule parameter. They need this parameter to read resources from the module address. EXE and DLL are generally loaded through memory map. If rebase and binding are performed, they do not occupy system storage, so they are read in the address space, it will read the corresponding content on the disk. In Windows, EXE and DLL can contain resources (bitmap, icon, dialog box...). After these resources are compiled by the resource compiler, embedded will be in the EXE/DLL file. Of course, you can choose not to include embedded resources in EXE or DLL. You can use functions such as LoadImage to directly read external files.

As for the image, it actually refers to the EXE file. It is not the meaning of the image.

Related Article

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.