Three types of DLLs supported by VC 6.0

Source: Internet
Author: User
Tags file size memory usage

NON-MFC Dlls (Non-MFC DLL) refers to the use of MFC's class library structure, directly written in C language DLL, its output function is generally standard C interface, can be written by non-MFC and MFC application calls. You can use the Win32 Application Wizard to create a non-MFC DLL project.

Regular Dlls (MFC Regular DLL), created by using the MFC DLL Wizard, is divided into static and dynamic links.

Extension Dlls (MFC extension DLL), created using the MFC DLL Wizard, always dynamically links MFC.

The following comes from msdn--to determine the type of DLL to use

If your DLL is to use MFC and will be used by MFC or non-MFC applications, you must generate a rule DLL that is dynamically linked to MFC or a regular DLL that is statically linked to MFC. In most cases, you might want to use a rule DLL that is dynamically linked to MFC because the file size of such a DLL is much smaller and using a shared version of MFC can save a lot of memory. If you are statically linked to MFC, the DLL will have a larger file size and may occupy additional memory because it loads its own copy of the private MFC library code.

Generating DLLs that dynamically link to MFC is faster than generating a DLL that is statically linked to MFC because the former does not need to link MFC itself. This is particularly true in debug versions where the linker must compress debug information. By linking to a DLL that already contains debugging information, only a small number of debugging information in the DLL will need to be compressed.

One disadvantage of dynamically linking to MFC is that shared DLL:MFCx0.DLL and MSVCRT must be published with DLLs. DLL (or a similar file). MFC DLLs can be easily republished, but you must still install DLLs in Setup. In addition the MSVCRT must be delivered. DLL that contains the C Run-time library to be used by both the program and the MFC DLL itself.

If the DLL is used only by MFC executables, you can choose to generate a rule DLL or an extension DLL. If your DLL implements a reusable class that derives from an existing MFC class, or if you need to pass MFC-derived objects between applications and DLLs, you must generate an extension DLL.

If your DLL is dynamically linked to MFC, you may want to republish the MFC DLL with a DLL. This structure is especially useful when you share a class library between multiple executables to conserve disk space and minimize memory usage.

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.