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:
- Project-< * * Properties-< Configuration Properties-< General-< Use of MFC: Use MFC in a static library.
- 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):
- 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.
- 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