If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

VB6 Program on Win7 32bit machine Run time error msg 0

Hello,
I am getting error msg of 0 (err.number) when i run my VB6 program on WIN 7 (32bit) machine. The line that generates the error is frmMain.Show
Any suggestions in troubleshooting and fixing this issue?
The program is run as Administrator
Regards

Re: VB6 Program on Win7 32bit machine Run time error msg 0

As pointed out on the other forum Err.Number 0 means that there is no error. If you are seeing this it is due to a mistake in your code, either you are using On Error Resume Next then checking the err.number after a line has executed without error or you are using a On Error Goto and do not have an Exit Sub above your error handler causing it to report error 0.

Re: VB6 Program on Win7 32bit machine Run time error msg 0

This error happens only on WIN 7 32 bit machine, after creating an exe and running it.
What do you mean by adding code to check for VB Errors. I added line after each code line and determined that the error is happening at frmMain.show line.

Re: VB6 Program on Win7 32bit machine Run time error msg 0

Well when a runtime error occurs it is held in the VB Err object if you check Err.Number then anything other than 0 indicates a problem. I have no idea what your DBEngine.Errors would be but I would think it safe to say that would have nothing to do with non database related errors such as file not found and other such things that may occur.

If the error occurs on frmmain.show then that would indicate that the error may be in the frmmain_load event or frmMain_resize or other such event that may fire when the form is loaded.

as for discovering what the error is there are a few ways you could do it.

1: Set the IDE break on all errors which will cause it to ignore your error handlers and break with an error message when an error occurs this shows you what the error is and where it occurs, though in the case of form.show the cause of the error is usually somewhere within that forms code.

2: In your error handler check the Err.Number if it is anything other than 0 then an error has occured and you can get the message by displaying err.description

3: You can use in line error handling by adding an On Error Resume Next before the troublesome line then after the line check the err.number and display if not = 0

Re: VB6 Program on Win7 32bit machine Run time error msg 0

I am building the exe on winxp machine and running it on win7-32bit machine
After adding the line of code suggested, now i actually get an error with description as below
339 Component 'comdlg32.ocx' or one of its dependencies not correctly registered: a file is missing or invalid

As mentioned before it is WIN7 32Bit machine, i think if find this component and registered it on the machine. Can you guide me where i can find this command to register?

how do i include this component in the app so it automatically registers itself when i run the exe on win7 machine?

Re: VB6 Program on Win7 32bit machine Run time error msg 0

Never use on error resume next .remove this line .and look the error . that is the main reason of the issue .

After adding the line of code suggested, now i actually get an error with description as below
339 Component 'comdlg32.ocx' or one of its dependencies not correctly registered: a file is missing or invalid

As mentioned before it is WIN7 32Bit machine, i think if find this component and registered it on the machine. Can you guide me where i can find this command to register?

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.