Re: Problem On Different PC
Are you distributing only the EXE?
Which line is giving this error?
Re: Problem On Different PC
I can't find out which line is giving me the error as the program works in the debug version (i.e. In VB itself)
The message comes up as soon as I click onto the EXE.
Re: Problem On Different PC
OK, are you just creating the EXE and copying on the other PC?
Plus have you added reference to any files in your VB project?
Re: Problem On Different PC
Yes i think you are just creating an exe and distributing it.
This will not work since VB requires a runtime file to be installed on the host machine. Try using the Package and Deployment wizard which should be in your VS folder. This will include all nessercery run times.
Pino
Re: Problem On Different PC
Thanks for your very quick response.
Yes I am just creating the EXE (I'll be honest, I know no other way to do it)
There are no references apart from the standard ones (VB for applications, VB runtime, VB objects and procedures etc)
Re: Problem On Different PC
Use the package and deployment wizard is the easiest to use, and will get the job done. Should be included with your VB install.
Its under Microsoft Visual Basic 6.0 Tools > P&D wizard
also more installers
http://www.vbforums.com/showthread.php?t=315829
Pino
Re: Problem On Different PC
Download MZTools.
Using it add line numbers to your code.
Then in the beginning of every sub add,
Just before all End Sub add,
VB Code:
Exit Sub
TrapErr:
MsgBox Err.Description & vbCrLf & _
"in Form1.Command1_Click " & _
"at line " & Erl, vbCritical Or vbOKOnly, "ERROR !"
Your code should look like this,
VB Code:
Private Sub Command1_Click()
On Error GoTo TrapErr
Dim strPath As String
10 strPath = "C:\WINXP\System32"
20 Text1.Text = Left(strPath, 3) 'Gets drive
30 Text2.Text = Right(strPath, Len(strPath) - 3)
Exit Sub
TrapErr:
MsgBox Err.Description & vbCrLf & _
"in Form1.Command1_Click " & _
"at line " & Erl, vbCritical Or vbOKOnly, "ERROR !"
End Sub
Change Form1.Command1_Click with your ComponentName.ProcedureName if you like.
Run compiled exe. When the error occours, a messagebox will be displayed with the line number. See that line in your code.
I have seen thin problem before. But I don't remember how I solved it.
Re: Problem On Different PC
And dont forget to add error handing to your project. :)
At least you will know the module name and the procedure which is causing this error.
You can have line numbers added to your source code, so you can get the exact line which is causing such problems.
See this:
http://www.aivosto.com/vbtips/errorhandling.html
There must be some free, demo addins and are very helpful
Re: Problem On Different PC
The problem is something related to Windows XP is all that i remember
Re: Problem On Different PC
iPrank, isnt the reason he will be getting the error because he hasnt created a install package?
Re: Problem On Different PC
Thank you all very much - I'll check it out when I get home tonight.
Cheers.
J.
Re: Problem On Different PC
Quote:
Originally Posted by Pino
iPrank, isnt the reason he will be getting the error because he hasnt created a install package?
Quote:
Originally Posted by Jonny1409
It works absolutely fine here when I create it, and I simply save it as an EXE to run on my home PC.
When I try to run it at home however, I get a message saying something along the lines of : System Error &H80070583 (-2147023485) Class does not exist
That said, if I open VB6 up at home, and run it from there, it seems to work fine.
I guess both here and his home has VB6 installed. And he is not using any extra dependencies.
So I guess it is not installer problem.
I have faced this problem in my development pc.
Re: Problem On Different PC
Just a minute,
Jonny1409, did you recompiled your app at home and tested again ?
It may be a service pack issue.