Avatar of BeckyBusch
BeckyBusch

asked on 

Ending a VB program

Problem:
I am using VB6.0 as my developing environment.  I am unable to properly end my program on a clean 95 machine. I get the error: "dmsUser caused an invalid page fault in module MFAC42.dll"
My thoughts:
I had thought that I wasn't unloading all forms, but this did not solve the problem.  I also thought I wasn't hitting the end.  But the error seems to occur when I hit the "END"
Has anyone had a problem like this?  What did you do to fix it??  This error only occurs on Windows 95 machines, where VB is not loaded.
Thanks in advance.
Visual Basic Classic

Avatar of undefined
Last Comment
BeckyBusch
Avatar of roverm
roverm
Flag of Netherlands image

Do you use the DataReport Designer ?
Avatar of BeckyBusch
BeckyBusch

ASKER

No we do not use the DataReport Designer
Avatar of tkuppinen
tkuppinen

This may or may not solve all your problems but you should never use End to terminate your program.  Unload your forms and set them to nothing.
Avatar of tkuppinen
tkuppinen

You should also explicitly destroy all object variables and close any connections to files or databases.
Avatar of BeckyBusch
BeckyBusch

ASKER

I do unload all forms, and set the main form = nothing.  I also close my connections to the DB.  Should I set all forms = nothing?
Avatar of crazyman
crazyman
Flag of United Kingdom of Great Britain and Northern Ireland image

try doing
dim f as form
for each f in forms
   if f.hwnd <> me.hwnd then    
       unload f
       set f= nothing
   end if
next f
unload me

this will unload all other forms before yours.
dunno if it will solve ur prob though
ASKER CERTIFIED SOLUTION
Avatar of pmwood
pmwood

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of BeckyBusch
BeckyBusch

ASKER

Thank you for your help.. I am building with a MFC42.dll, and the 95 machine has a 4.2 version of the MFC42.dll
Thanks again!
Visual Basic Classic
Visual Basic Classic

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.

165K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo