Results 1 to 21 of 21

Thread: Strange error after compiling

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    25

    Exclamation Strange error after compiling

    1. "strange" means its not a runtime error but an error which is caused by MSVM60.dll AND it only happens in Win9x/ME

    2.Thats the procedur's code where this error appears:

    Public Sub FillList()
    Dim i As Long, tmp As Long

    lst.Clear

    ' Get the function work even if the array is erased
    On Error Resume Next
    tmp = -1
    tmp = UBound(ArrayPersons)
    On Error GoTo 0

    For i = 0 To tmp
    With ArrayPersons(i).NameInfo
    If Not len(.Name)=0 Then
    ' If I put in a 'msgbox "blablabla"' right here I get runtime error '10' DURING the message box is shown
    lst.AddItem .Title & vbTab & .Name & vbTab & .Nick
    lst.ItemData(lst.NewIndex) = i
    End If
    End With
    Next

    End Sub
    (I hope it wasn't my mistake )
    Visual Basic

  2. #2
    PowerPoster
    Join Date
    Aug 2002
    Location
    NY, NY
    Posts
    2,139
    That error (whatever it is) may occur because program must delay some other simiutanious excution while MsgBox is shown. I'd suggest to use DoEvents inside your loop to be on the safe side. So, it could look like:
    VB Code:
    1. With ArrayPersons(i).NameInfo
    2.     For i = 0 To tmp
    3.         DoEvents
    4.         If Not len(.Name)=0 Then
    5.             MsgBox "blablabla"
    6.             lst.AddItem .Title & vbTab & .Name & vbTab & .Nick
    7.             lst.ItemData(lst.NewIndex) = i
    8.         End If
    9.     Next
    10. End With
    Roy

  3. #3
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Can you leave out the messagebox altogether, and report any messages at the end of the loop?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  4. #4
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    Timers can run asyncrounously to msgboxes, so it could be one of you timers causing problems.
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  5. #5
    PowerPoster
    Join Date
    Aug 2002
    Location
    NY, NY
    Posts
    2,139
    In any case you should ALWAYS consider to include Error Handler in most of your procedures. It may look as follows:
    VB Code:
    1. ....
    2. On Error GoTo ErrClear
    3.  
    4.     'some code
    5.  
    6. ErrClear:
    7. '------------
    8.     Err.Clear
    9.     Resume Next
    Roy

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    25
    Thank you, But the problbem is still there.

    1.I dont get a runtime error but a system error... you know those beautiful message boxes with the red X "Critical error - app closed" - An error handler doesnt catch them.
    2.If I put the message box in there im lucky enought to get a runtime error not a system related one. - A break through, isnt it?
    3.Ive also tried a DoEvents in there but the error is still there.

    after some debugging at runtime ive figured out that the error occurs if im accessing entries around i=15.

    In addition as I said allready it only occurs in win9x/ME not in NT/2k/XP... Could the MSVB60.dll be buggy?
    Visual Basic

  7. #7
    Fanatic Member Geespot's Avatar
    Join Date
    Oct 2001
    Location
    Birmingham, UK
    Posts
    577
    What exactly is the error?

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    25
    Thats the error message:



    Its german but i think you know these message boxes
    Visual Basic

  9. #9
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Yes the dialog is familiar, but which dll is it referencing that caused the crash?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    25
    MSVBVM60.dll - Thats the most important file for VB6
    Visual Basic

  11. #11
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Perhaps it's the negative one issue for the tmp variable?

    You could have this situation

    VB Code:
    1. For i = 0 to tmp ' what if tmp = -1

    See what I mean?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  12. #12
    Fanatic Member Geespot's Avatar
    Join Date
    Oct 2001
    Location
    Birmingham, UK
    Posts
    577
    ummm this might sound totally wack but

    are there more than 366 items being added?
    try looping upto 366

    for i = 0 to 366


    then run compile and run

    ( im just testing something so this post might seem strange )

    tell me if it crashes then



    P.S This is a loooooong shot

  13. #13
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Originally posted by Geespot
    ummm this might sound totally wack but

    are there more than 366 items being added?
    try looping upto 366

    for i = 0 to 366


    then run compile and run

    ( im just testing something so this post might seem strange )

    tell me if it crashes then



    P.S This is a loooooong shot
    What are you getting at here? The declaration of the variable?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  14. #14
    Fanatic Member Geespot's Avatar
    Join Date
    Oct 2001
    Location
    Birmingham, UK
    Posts
    577
    what it is,

    the CS register is 0x016f which is 367

    and the CS register is used for incrementing variables ( i think! )

    and as there is a for-next there, i just took a wild guess lol

  15. #15
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Originally posted by Geespot
    what it is,

    the CS register is 0x016f which is 367

    and the CS register is used for incrementing variables ( i think! )

    and as there is a for-next there, i just took a wild guess lol
    Wrong thread GeeSpot?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  16. #16

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    25

    Angry problem is still there

    Yipey! I like asm , but i have to solve this problem in VB.

    After some runntime debugging I found out that the program crashes if "i" is around 15.
    Maybe there is somebody who knows how to solve/go around this problem.

    PS.:
    if tmp=-1 the loop doesnt execute
    Visual Basic

  17. #17
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    How is i declared ? As byte ? As Integer? . . .
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  18. #18

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    25
    "i" is declared as Long

    the array is declared as a UDT - There are Longs, var Strings, other UDTs and booleans.
    Visual Basic

  19. #19
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    The array is a UDT ? Please post your code..
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  20. #20

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    25
    Thats the UDT's structure (very complex and german again ):

    VB Code:
    1. Public Type nName
    2.     Titel As String
    3.     Name As String
    4.     Vorname As String
    5. End Type
    6.  
    7. Public Type nAdresse
    8.     Adresse As String
    9.     PLZ As String
    10.     ORT As String
    11. End Type
    12.  
    13. Public Type nTelefon
    14.     Telefon As String
    15.     Mobiltelefon As String
    16.     Fax As String
    17.     EMail As String
    18. End Type
    19.  
    20. Public Type nDienstgeber
    21.     Name As String
    22.     Adresse As nAdresse
    23.     TelInfo As nTelefon
    24. End Type
    25.  
    26. Public Type nKrankenschein
    27.     Nummer As Long
    28.     Typ As Integer
    29.  
    30.     ÜberweisungTyp As Integer
    31.     ÜberweisungArzt As Long
    32.  
    33.     DatumAbgabe As Date
    34.     DatumBehandlung As Date
    35.     DatumÜberweisung As Date
    36.  
    37.     Zusatz As Integer
    38.     Inaktiv As Integer
    39. End Type
    40.  
    41. Public Type nPatient
    42.     NameInfo As nName
    43.     Geschlecht As Integer
    44.     Versicherung As Integer
    45.     VersicherungBundesland As Integer
    46.     VersicherungNummer As String
    47.     Adressen As nAdresse
    48.     TelInfo As nTelefon
    49.     Zuweiser As Long
    50.     KarteiPath As String
    51.     Geburtsdatum As String
    52.     Notizen As String
    53.     Versicherter As Long
    54.     VersicherterKat As Integer
    55.  
    56.     Nummer As Long
    57.     Angehörige() As Long
    58.     Scheine() As nKrankenschein
    59.     Dienstgeber As nDienstgeber
    60. End Type
    Last edited by Xela001; Oct 3rd, 2002 at 02:47 PM.
    Visual Basic

  21. #21

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    25
    Maybe I can go around that problem by writing a c++ dll, but this would cause much lower speed and much more work - do you have some other ideas?



    hey, James where are you?
    Visual Basic

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