[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Windows 7 MFC  Application - Faulting module name: MFC42.DLL

Posted on 2014-08-29
16
Medium Priority
?
4,209 Views
Last Modified: 2015-01-29
I have a MFC application that was installed for a user in Windows-7 and it works as intended;  When another user logs into the Win-7 machine and tries to run the application, they get an "Unsupported operation was attempted" error and the MFC application fails to launch.  I looked at event viewer and listed the error details below.  It appears that only the user that installed this application can run this software successfully.  

I've changed the security settings of the folder/application to ensure that all users have all the necessary rights, run as administrator, compatibility mode, etc, to no avail.

Any help is greatly appreciated.

Faulting module name: MFC42.DLL, version: 6.6.8064.0, time stamp: 0x4d79b238
Exception code: 0xc0000005
Fault offset: 0x0005ae34
Faulting process id: 0x18e4
Faulting application start time: 0x01cfc38989704101
Faulting application path: C:\Program Files (x86)\Test\Test.exe
Faulting module path: C:\windows\system32\MFC42.DLL
0
Comment
Question by:arunykand
  • 7
  • 3
  • 3
  • +2
16 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 668 total points
ID: 40292604
Try to create a release build with debug information (see http://msdn.microsoft.com/en-us/library/vstudio/fsk896zz%28v=vs.100%29.aspx  - "How to: Debug a Release Build") and run that on the machine in question as the other user under Dependencywalker's (www.dependencywalker.com) "Profile mode". This will yield a lot more of information about what's going on which should help you narrow down the issue.
0
 
LVL 12

Assisted Solution

by:trinitrotoluene
trinitrotoluene earned 668 total points
ID: 40296848
as has been mentioned in the expert comment it is quite possible that some of the dlls required by your application are missing when a different account is used.

Try using dependency walker as has been suggested to narrow down the required dlls

You can also check whether both user accounts are identical. Do they belong to the same group, have the same permissions?
Do both accounts have access to the VC++ runtime libraries

You can try installing the VC++ runtime libraries for the 2nd account where the error occurs. Use the same version as was used when you created the original application. You haven't mentioned what version of the runtime you are using.

Here is the link to the Visual Studio 2010 redistributable. Remember to download the version you need
http://www.microsoft.com/en-au/download/details.aspx?id=5555
0
 
LVL 86

Expert Comment

by:jkr
ID: 40297652
I wasn't implyig that some DLL is missing. The error message would tell that right away and not cause an exception, which can only occur in DLLs that are in fact there.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:arunykand
ID: 40298577
Thanks for the suggestions, I will look into it more...

Question:  If this MSI installer had the 'Install for all users', would this problem not have occurred?

I am trying to see if I can modify the MSI package through ORCA to see if I can turn on any flags for 'Install all users', but I can't seem to locate it.  Any help in this area?

Thanks All!
0
 
LVL 86

Expert Comment

by:jkr
ID: 40299797
>>Question:  If this MSI installer had the 'Install for all users', would this problem not have occurred?

Might be possible, but it's not sure at this stage. IF a module was missing, the app would not start in the 1st place. If a setting is missing, that could be the reason. But, with the above, you will at least be able to locate the faulting method and parameter, so this will definitely narrow down the issue.
0
 
LVL 12

Expert Comment

by:trinitrotoluene
ID: 40300727
try

your.msi ALLUSERS=2 /s /q

Open in new window

0
 
LVL 12

Expert Comment

by:trinitrotoluene
ID: 40300735
0
 
LVL 12

Expert Comment

by:trinitrotoluene
ID: 40300742
I am not familiar with Orca but reading around I think Orca should have a "property" section under which you should find "ALLUSERS"
0
 
LVL 12

Expert Comment

by:trinitrotoluene
ID: 40300745
I mean when you open the msi the installer tables displayed by Orca,should show a "property" section or category
0
 

Author Comment

by:arunykand
ID: 40304554
I did look at ORCA property but there is no existing setting for all users and for some reason its opening my MSI as read-only.
0
 
LVL 12

Expert Comment

by:trinitrotoluene
ID: 40305226
just try running the installer as per my previous comment

your.msi ALLUSERS=2 /s /q

Open in new window

0
 
LVL 35

Assisted Solution

by:sarabande
sarabande earned 664 total points
ID: 40310509
the mfc42.dll contains some runtime functions of mfc 4.2 version (which is a rather old mfc version). for example function SetViewportExtEx, a GDI function, was exported via mfc42.dll.

if it crashes with code 0xc00000005 it means it is 'access violation' what is a synonym for pointer error. for example the crash could happen because a null pointer was passed to a mfc function instead of a valid pointer. in your case the null pointer could be caused because loading of a file or some other data failed due to the different user environments and the fail condition was not properly handled by your code or by the mfc classes you were using.

if your application has settings in the windows registry, these settings should be set at first call automatically into HKEY_CURRENT_USER section of the (32-bit Wow6432Node) registry. the 'AllUser' option at setup may not help for existing users as it would only provide the defaults for new users and the application itself must provide (or copy) the settings at first start for existing users. if you don't know how the settings were installed, check your own registry entries for the application (both HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE), export them to a .reg file and import the file after logged-in with the user's account by using 'regedit filename.reg' from command window. before, you could check whether your app is an OLE server by calling the exe at the user's account with 'yourapp.exe /REGSERVER'. any OLE server provides an interface to handle such a call from command line. note, if the entries are below HKEY_LOCAL_MACHINE, the command window must be opened with administrator rights. any of the operations would tell you if they were run successfully or not.

Sara
0
 
LVL 12

Expert Comment

by:trinitrotoluene
ID: 40311174
>>>> the 'AllUser' option at setup may not help for existing users as it would only provide the defaults for new users and the application itself must provide (or copy) the settings at first start for existing users.

@sara the above statement assumes that settings are changed from the defaults at startup.
Default values can be set for all users on an install so that an access violation does not result on app startup. It is not mandatory that user settings should be changed dynamically on app startup.
0
 
LVL 35

Expert Comment

by:sarabande
ID: 40311441
It is not mandatory that user settings should be changed dynamically on app startup.
it is the only way to get registry settings to the HKEY_CURRENT_USER section of windows registry when the account where the setup was done with was differently to the user account where the application was run at. HKEY_CURRENT_USER will not be updated from HKEY_USERS where only the defaults for new users could be stored. so, the alternative to let the application make its settings itself at start (for example by self registration via /Regserver) is to using HKEY_LOCAL_MACHINE section read-only or to have a separate "setup" which runs at user account or to using a configuration file from a public folder.

Sara
0
 

Expert Comment

by:BygRob
ID: 40576850
What did you end up doing? I have the exact same problem.  Can I just uninstall and reinstall under the different user? The previous user is no longer with the firm.  I have not deleted the old users profile.  Please let me know.
0
 
LVL 35

Expert Comment

by:sarabande
ID: 40577041
Can I just uninstall and reinstall under the different user?
yes. both the uninstall and the new setup should be done 'as administrator'.

Sara
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question