Solved

Runtime Error 31037 "Error while file is loaded"

Posted on 1998-05-27
13
2,906 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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
 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month5 days, 8 hours left to enroll

627 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