Results 1 to 9 of 9

Thread: VB Application crashing over innocuous line

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2003
    Posts
    30

    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

  2. #2
    Addicted Member
    Join Date
    Jul 2002
    Location
    new zealand (kiwi)!
    Posts
    202
    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?

  3. #3
    Member Swishy's Avatar
    Join Date
    Feb 2003
    Location
    Huntsville, AL
    Posts
    39
    It says it created an error log. What does the error log have to say about all this?

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Sep 2003
    Posts
    30
    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

  5. #5
    Lively Member
    Join Date
    May 2004
    Posts
    98
    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.

  6. #6
    Member Swishy's Avatar
    Join Date
    Feb 2003
    Location
    Huntsville, AL
    Posts
    39
    Quick fix idea:

    Where it's setting the tag to "", add this to the line after the Sub/Function:

    VB Code:
    1. On Error Resume Next

    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.)

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Sep 2003
    Posts
    30
    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)

  8. #8
    Lively Member
    Join Date
    May 2004
    Posts
    98
    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.

  9. #9
    Member Swishy's Avatar
    Join Date
    Feb 2003
    Location
    Huntsville, AL
    Posts
    39
    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
  •  



Click Here to Expand Forum to Full Width