Link to home
Start Free TrialLog in
Avatar of LordSauce
LordSauce

asked on

VB6 invalid page fault in MFC42.DLL

I am having trouble with the VB6 (SP5) IDE crashing as it completes execution of a program.

It raises the following errors:

VB6 caused an invalid page fault in
module MFC42.DLL at 0157:5f407140.
Registers:
EAX=057a0810 CS=0157 EIP=5f407140 EFLGS=00010246
EBX=11013854 SS=015f ESP=007ff7c8 EBP=007ff7e4
ECX=02d33550 DS=015f ESI=02d33550 FS=0cd7
EDX=817bf72c ES=015f EDI=00000000 GS=0000
Bytes at CS:EIP:
ff 50 18 8b 45 f0 8b 4d ec 89 48 04 eb 35 8b 41
Stack dump:
00000000 110138a4 00000000 005f770c 007ffe28 5f4964ab 00000000 007ff810 5f416a72 660292dc 02d33560 110138a4 11013854 11013854 007ff81c 00000000

then:

VB6 caused an invalid page fault in
module SSSCC.DLL at 0157:60550eb3.
Registers:
EAX=00000000 CS=0157 EIP=60550eb3 EFLGS=00010246
EBX=60480000 SS=015f ESP=03d6fbe0 EBP=03d6fc10
ECX=00000000 DS=015f ESI=03860650 FS=4e8f
EDX=817fb990 ES=015f EDI=00000001 GS=0cc6
Bytes at CS:EIP:
8b 71 04 85 f6 57 74 23 8b 7c 24 0c 33 d2 8b c7
Stack dump:
03860650 60554198 00000e68 60480000 00000001 03860650 60553ffa 03860650 03860650 03d6fc20 6056ed2c 00000000 03d6fc2c 6055f583 03860650 03860650

I am using version 6.00.8665.0 of MFC42.dll and version 06.00.8987 of sssc.dll, running on Windows 95.

Any thoughts?

Jon.
Avatar of hes
hes
Flag of United States of America image

Check to see if you have more than 1 mfc32.dll on your system. If you do rename all of the mfc42.dll except for the one in the windows\system folder.
Avatar of LordSauce
LordSauce

ASKER

Tried renaming the second copy I found - no change.
Hi
First dump:
>>EDI=00000000<< usually pointer to a function. It means that some API function not present/incorrect version.
second dump:
>>EAX=00000000<< >>ECX=00000000<< this regisers usually use for memory addresses to copy. Zero address cause GPF.

AFAIK, MFC42 was developed for win95 OSR2 and higher, so if you haven't OSR2 pack for w95, some functions may not be present. Try to install OSR2 for w95, or better w98.

Cheers
Try this

Replace MFC42.DLL located in windows\system with the MFC42.DLL from Visual Studio CD os\system.


or

If Microsoft Visual SourceSafe is integrated with Visual Basic:

Click Start, and then click Run. Type the following commands in the text box:


regsvr32 "<x>:\<path>\ssscc.dll"

where <x>:\<path> is the location of the Ssscc.dll file



If Microsoft Visual SourceSafe is not integrated with Visual Basic:

1. Start Visual Basic.
2. From the Add-Ins menu, click Add-In-Manager.
3. Under Available Add-Ins, select Source Code Control.
4. In the Loaded Behavior option box, clear the Loaded/Unloaded and Load on Startup check boxes.
5. Exit Visual Basic.


Sounds like you are in DLL hell.

An older copy of MFC42 has been installed and registered on your computer by the looks of it.

Question 1 when did this happen. i.e. after a install of another application ?

Ok try the following:

Reapply Service pack 5 for Visual Studio this should install the correct version of MFC42

If this has happened I'd say other DLL's have been copied over also. So reapplying the service pack may solve this.

Vin.





A note to JaganMohan.

It's common practice to post comments not propose answers on this forum.

Please look at the guidelines for proposing answers.
 
https://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp

Vin.
Thanks all for your comments.

Ark - not sure how to tell if I'm on OSR2 or not - system properties says MS Win 95 4.00.950 B.

JaganMohan - VSS is integrated with VB, the dll is registered, no change. Also, replaced MFC42.dll with the one from the SP5 CD, still no change.

Vin - Not quite sure what originally happened to cause the problem. Since I originally posted I've re-installed VB and SP5 - problem still occurs.

One thing which seems strange to me is that it the crash does not happen every time I use VB - I can cause it by creating a project with a reference to a certain ActiveX dll, but if the project for the dll is added then it stops crashing... Without a reference to the dll VB seems much more stable.
Have you tried rebuilding the other DLL it sounds like it is expecting an newer version of MFC42 for example if it was developed with VC++ 6 and you are using VB5.

Vin.
Sorry about that you are using VB6.

Another thing that Microsoft in their wisdom have done is changed the ordinal numbers on some of the DLL entry points in MFC42.
Try rebuilding the other DLL in your current environment.

Vin.
Forgot to mention they did this between sp3 and sp5 of Visual Studio causing all kinds of trouble.

Vin.
If this proposed answer has helped you, please accept it, grade it and close this question.  If it did not, reject it and add comments as to your progress and what else is needed.  If no action is taken here by next week, we'll need to decide this outcome.  Expert input always welcome as well.

Thanks,
Moondancer
Community Support Moderator @ Experts Exchange
As explained in comments of 09/04/2001 01:26AM PST, the proposed answer did not work.
Would you like a refund for this so that I can close it and move it to the PAQ, after which you can repost, include this link and draw current attention?  This is a very high volume topic area and few are likely to find questions this old.

Moondancer
Community Support Moderator @ Experts Exchange
Moondancer - thanks, that sounds like a good plan.
ASKER CERTIFIED SOLUTION
Avatar of Moondancer
Moondancer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial