Solved

Runtime Error 31037 "Error while file is loaded"

Posted on 1998-05-27
13
2,841 Views
Last Modified: 2008-02-01
I did a system and a tried to install it in a commputer that doesn't have Visual Basic. When I try to read a file with
the Common Dialog this error appears (Error 31037 "Error while file is loaded"). The program works fine on  some other
machines, I don't know what is happening. Could it be that the resident machine has a 486 processor and the development machine and the others have a pentium processor?
I work with three common dialogs in differents parts of the system. In one part the common dialog open my file fine. In other menu option of the program I used another common dialog an it couldn't open the same file.
I hope you can answer my question.
Pepe
Thank you
I am using VB 4. The machine where the problem rise use Windows 95. The versions of the common dialog I use are comdlg32.ocx (Common Dialog Custom ActiveX Control Version 5.0)
I am not adding extra controls. I am using the normal common dialog.
I expect your answer.
Pepe
0
Comment
Question by:al361345
13 Comments
 

Author Comment

by:al361345
ID: 1461838
Edited text of question
0
 

Expert Comment

by:cmoore23
ID: 1461839
Some questions for you that may help in diagnosing your common malady.....

Are you talking Visual Basic 3, 4 or 5?
Are your machines using Windows3.1, 3.12 or Windows95?
Are you using cmdialog.vbx, commdlg.dll?  What versions?
Are you using comdlg32.ocs, comdlg32.dll?  What versions?

If you run your application and invoke the 'working' common dialog then re-run the application and invoke the 'non-working' common dialog, what happens? (Both work? Both fail? one fails, one works?)


Are both 'parts' of your application in the same .EXE file?

Are you doing anything *special* such as adding extra/custom buttons to the dialog box etc that are not achieved via the standard common dialog interface?  

If you can answer some of these it will help.

Chris.
0
 

Author Comment

by:al361345
ID: 1461840
Edited text of question
0
 

Author Comment

by:al361345
ID: 1461841
Edited text of question
0
 

Expert Comment

by:cmoore23
ID: 1461842
'Runtime Error 31037 "Error while file is loaded' can frequently
occur when a number of DLLs have conflicting versions.  That is
my first guess.

On the computer where you created your program, start EXPLORER and :

1) RIGHT CLICK on the file C:\WINDOWS\SYSTEM\COMDLG32.OCX. Then select PROPERTIES from the popup menu and click the VERSION tab. Write down the version number.

2) RIGHT CLICK on the file C:\WINDOWS\SYSTEM\COMDLG32.DLL.  Then select PROPERTIES from the popup menu and click the VERSION tab. Write down the version number.

THEN:

On the computer where your program errors, start EXPLORER and :
3) RIGHT CLICK on the file C:\WINDOWS\SYSTEM\COMDLG32.OCX.  Then select PROPERTIES from the popup menu and click the VERSION tab. Write down the version number.
4) RIGHT CLICK on the file C:\WINDOWS\SYSTEM\COMDLG32.DLL.  Then select PROPERTIES from the popup menu and click the VERSION tab. Write down the version number.

Update your question to include the versions of all these files.

Also, can you tell me how you distribute your program to the other computer.  Do you just copy the .EXE file or do you use the Visual Basic Setup Kit?


0
 
LVL 1

Expert Comment

by:web_crusher
ID: 1461843
copy the vb4 commondialog that you're using to your \winsys\ directory
then it will work fine - dont forget to update the comdlg32.ocx - you can find it anywhere in the net - or on http://www.nonags.com - under missing files options!
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:al361345
ID: 1461844
Thank you web_crusher. I did what you told me and it didn't work. I expect more coments from you.
0
 

Author Comment

by:al361345
ID: 1461845
Adjusted points to 200
0
 

Author Comment

by:al361345
ID: 1461846
I use the setup kit to distribute my program. It worked fine only once, but after that I started to have problems.
0
 

Accepted Solution

by:
cmoore23 earned 200 total points
ID: 1461847
Pepe, try this:

First copy COMDLG32.DLL from your 'working' machine to the 'not working' machine.

Then copy COMDLG32.OCX from your 'working' machine to the 'not working' machine.

Then TEST your program.

If it still does not work, REJECT my answer and I will try again to help you.




0
 

Author Comment

by:al361345
ID: 1461848
Thank you, cmoore23, It worked. Sorry I hadn't time to verify the answer until now.
Thank you again.

361345
0
 

Expert Comment

by:cmoore23
ID: 1461849
Pleased to be of assistance  :)

0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1461850
Bought This Question.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now