Link to home
Start Free TrialLog in
Avatar of al361345
al361345

asked on

Runtime Error 31037 "Error while file is loaded"

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
Avatar of al361345
al361345

ASKER

Edited text of question
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.
Edited text of question
Edited text of question
'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?


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!
Thank you web_crusher. I did what you told me and it didn't work. I expect more coments from you.
Adjusted points to 200
I use the setup kit to distribute my program. It worked fine only once, but after that I started to have problems.
ASKER CERTIFIED SOLUTION
Avatar of cmoore23
cmoore23

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
Thank you, cmoore23, It worked. Sorry I hadn't time to verify the answer until now.
Thank you again.

361345
Pleased to be of assistance  :)

Bought This Question.