Rajesh Katalkar :
but the program works on the computer where it was not working
without any modification if built on some other machine
This still supports my answer. The following will be happening in a situation like this:
Build computer
A
compiled the project with Visual Studio
W
, which has MFC
X
Build computer
B
compiled the project with Visual Studio
Y
, which has MFC
Z
This means that the project requires different versions of the Visual Studio Redistributable files.
So, the computer you were testing the project on may only have the redistributable files required by Build computer
B
, meaning the project will only work if it was compiled from that computer.
You can verify by what I am saying by grabbing a copy of
Dependancy Walker[
^] and opening the executable file. This will show the DLL files required for the program to run. There will be files named something like
MSVCRT
,
MSVCR
,
MSVCM
,
ATL
,
MFC
, ...
All these files will have a version number in the name, and can be found in the Side-by-Side directory
C:\Windows\WinSxS
(SxS = Side-by-Side)
If you run Dependancy Walker on the build computer it will find all the required DLLs, if you run it on a computer that shows the error message, it will show an error message saying that it couldn't find all the dependencies.
Both solutions from my previous answer will correct this problem will correct it.