C + + programs written in VS2010, cannot be run on other computers, suggesting a lack of mfc100.dll solutions

Source: Internet
Author: User

Problem:

VC + + programs written on their own computers (using the MFC library) are not allowed to run on other computers. VS2010 Double-click the hint:

"This program cannot be started because the computer is missing Mfc100.dll try to reinstall the program to resolve this issue." ”

Solution:

Scenario one with static compilation
When a program compiled with VS2010 is run in WindowsXP, there are often no associated DLL files found, and we can use a statically compiled method to package these run dependent files into the *.exe to reduce the dependency on the environment.

You can typically configure the following two items:

    1. Project-< * * Properties-< Configuration Properties-< General-< Use of MFC: Use MFC in a static library.
    2. Project-< * * Properties-< Configuration Properties-< C/C + +-< code generation-< Runtime: Multithreaded (/MT).

Scenario two package The Mfc100.dll with the application and add the installation control's documentation to the package
Attached: Mfc100.dll Control General Installation Method (description file):

    1. Copy the downloaded Mfc100.dll to the specified directory (typically the system directory or the software sibling), or re-add the file reference. If your system is a Windowsxp/win7/vista system (32-bit), copy the Mfc100.dll to the C:\Windows\System32 directory, or copy the file to the C:\WINDOWS\SYSWOW64 directory if your system is 64-bit.
    2. Click Start-< Run, enter "Regsvr32mfc100.dll", return can be resolved.

or save the following code as "register. Bat" (method: Create a new. txt document, save close after opening the document entry code, change the file name and the extension "register. bat"), and put it in the DLL file sibling directory (as long as there are two files in the same folder), Double-clicking Register. BAT will automatically complete the Mfc100.dll registration (win98 not supported).

The following is a 32 system registered BAT file (64-bit) please replace the following System32 with SysWOW64. )

The code is as follows:

@echo Start Registration

Copy Mfc100.dll%windir%\system32\

regsvr32%windir%\system32\mfc100.dll/s

@echo Mfc100.dll registered successfully

@pause

Scenario three package The program and Vcredist_x86.exe together (or prompt the user to download and install Vcredist_x86.exe)

Download and install Vcredist_x86.exe.

Vcredist_x86.exe:

http://www.microsoft.com/zh-cn/download/details.aspx?id=8328

C + + programs written in VS2010, cannot be run on other computers, suggesting a lack of mfc100.dll solutions

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.