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

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
arunykandAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
trinitrotolueneDirector - Software EngineeringCommented:
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
jkrCommented:
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
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

arunykandAuthor Commented:
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
jkrCommented:
>>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
trinitrotolueneDirector - Software EngineeringCommented:
try

your.msi ALLUSERS=2 /s /q

Open in new window

0
trinitrotolueneDirector - Software EngineeringCommented:
0
trinitrotolueneDirector - Software EngineeringCommented:
I am not familiar with Orca but reading around I think Orca should have a "property" section under which you should find "ALLUSERS"
0
trinitrotolueneDirector - Software EngineeringCommented:
I mean when you open the msi the installer tables displayed by Orca,should show a "property" section or category
0
arunykandAuthor Commented:
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
trinitrotolueneDirector - Software EngineeringCommented:
just try running the installer as per my previous comment

your.msi ALLUSERS=2 /s /q

Open in new window

0
sarabandeCommented:
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
trinitrotolueneDirector - Software EngineeringCommented:
>>>> 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
sarabandeCommented:
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
Rob DuranSystems Network EngineerCommented:
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
sarabandeCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 7

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.