|
-
Jul 21st, 2004, 03:47 AM
#1
Thread Starter
Junior Member
VB Application crashing over innocuous line
Hi guys,
I've encountered a problem with an application which occurs on two or three machines (out of several hundred).
I have a function which contains an On Error on the first line. On most PC's this function executes flawlessly. On a couple however, it fails on this line: -
frmMyForm.Tag = ""
The error, which appears to be a compiler error, is as follows: -
MyApp.exe has generated errors and will be closed by Windows. You will need to restart the program.
An error log is being created.
So far, I've tried reinstalling the VB runtime on one of these PC's and ensuring that the application was not compiled on a PC with Service Pack 5 installed as I understand there were problems with this SP.
Any Ideas?
Also, does anyone know where I could get hold of an application that traces function calls as the problem "may" be due to a corrupt DLL which, if the .Tag property calls, would explain the crash (though I find it unlikely that setting a .Tag property would require an external DLL function call).
Cheers in advance,
Rob
-
Jul 21st, 2004, 04:26 AM
#2
Addicted Member
Is there an upgrade after SP5?
I thought it was the latest/last version service pack...
Just a wild guess re your problem:
is there a chance the frm is not loaded when the Tag
line executes?
-
Jul 21st, 2004, 04:27 AM
#3
Member
It says it created an error log. What does the error log have to say about all this?
-
Jul 21st, 2004, 04:46 AM
#4
Thread Starter
Junior Member
The company standard SP is 4. However, new machines are being loaded up with SP5.
I guess there is a possibility that the form is not loaded, though as soon as I reference the form is should create an instance of it
(ie. try creating a project with 2 forms, in Form1 put Form2.Tag = "Hi" in the form load, in Form2 put msgbox("Hi") in the form load and then run the app).
However, even if it did cause a problem it should have been caught by the error handler. In this case the application crashes immediately the .Tag is encountered.
As for the error log, I can't find it. So I don't know what it contains.
Cheers guys,
Rob
-
Jul 21st, 2004, 04:53 AM
#5
Lively Member
Originally posted by BountyBob
As for the error log, I can't find it. So I don't know what it contains.
Start -> Control Panel -> Admin Tools -> Event Viewer. You'll probably want to look at the application log.
-
Jul 21st, 2004, 06:12 AM
#6
Member
Quick fix idea:
Where it's setting the tag to "", add this to the line after the Sub/Function:
Until you can find the problem, that will be a quick fix, I suppose. It will ostensibly keep the program from complaining and crashing. (However, if the program's operation is critical on the Tag being empty, I don't recommend this.)
-
Jul 21st, 2004, 08:05 AM
#7
Thread Starter
Junior Member
Cheers for the reponses guys. The event viewer didn't contain anything that would help.
Also, the function contains an error handler in the first line of code. However, it is not being executed. The error would appear to be a compiler error (ie. beyond the realms of defensive coding)
-
Jul 21st, 2004, 04:20 PM
#8
Lively Member
Try posting the event viewer log when the application crashed ... it might give us some idea of what's wrong even if it doesn't make sense to you.
-
Jul 22nd, 2004, 12:22 AM
#9
Member
You might try compiling to another kind of code for S&G's. For example, if you're going to "P-Code", try "Native Code".
Can you post some of the code around that line -- preferably the sub/function in which it resides. (If you don't want to post the whole thing, that's understandable. It's your code.)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|