Works on Mac not on Windows

Hi, I have developed an Application that include a listbox.

I wrote a code within the listbox CellKeyDown event to use the Tab and Return keys.

This code works fine in Mac but it crashes on Windows, any suggestion? (Windows 10)

select case key
case chr(9) 'Tab Key

If Row<9 then
  if column = 3 and me.Cell(Row+1,2) ="Custom" then
    iColumn = 3
    iRow = row+1
    me.EditCell(row, column+1)
  end if
  if column = 5 then
    me.EditCell(row+1, 4)
  End If

  If Row<12 then
    me.EditCell(row, column+1)
    if column = 5 and Row+1<>12 then
      me.EditCell(row+1, 3)
    End If
  End If
End If

case chr(13) 'Return Key
me.EditCell(row+1, column-1)

End Select

define “crash”… error message? breakpoint line? silent?

where you indicate ROW+1 (or iROW)… is that value still less than ROWCOUNT at that point in the code?
but that would cause a crash on BOTH OSX and WIN, same with COLUMN-1 etc.

It happens even though the IDE (2016 r1) is installed in Window running the source code

Ok… but posting pictures with no context, and an error box that is not only too small to read, but if it were legible, not everyone understands spanish…

and now that you mention 2016, did you follow the instructions about the “redistributables” required by windows now?

You mean this is a run in the IDE ? Is it simply the debug program that ceased to work or does the IDE stops as well ?

Have you implemented App.UnhandledException event ? Can you look at the stack to see where this happens ?

If you really cannot trace that in the code, you may try to get a minidump to submit to Xojo together with your project with the Feedback app :

Thanks for the quick response :

The Spanish warning windows message means :

The application D_Budget does not function anymore (Have crashed) due to a problem. Windows will close the program and will try to get a solutions.

Context : The user entered a value, then pressed the Tab Key
Result : Crash

Thanks again, I will read the instructions about “redistributables”

This would definitely be best.

Thanks… It seems that this could be the way because I can not trace the bug. Thanks again

The Tab key works fine through text fields but not within a listbox.

Maybe I misunderstand. If you compile the program, does it do the same thing? If you set the compatibility of XOJO ( if running from IDE, or your .exe ( if compiled ) to Win 7 does that help?

If I compile it does the same thing than running from the IDE. Excuse my ignorance. Where can I set the compatibility to Win 7?

Right click the .exe…

Thanks … Oh my … excuse me.

Michel Bujardet : Thanks, I implemented the App.UnhandledException event and included :

If error <> Nil Then
Dim type As String = Introspection.GetType(error).Name
MsgBox(type + EndOfLine + EndOfLine + Join(error.Stack, EndOfLine))
End If

the debug program ceased to work but the IDE don’t and the same message appears. I can’t look at the stack to see where this happens.

I set compatibility to Windows 7 … nothing new happened … how weird …

[quote=262152:@Hernan Pisani]If error <> Nil Then
Dim type As String = Introspection.GetType(error).Name
MsgBox(type + EndOfLine + EndOfLine + Join(error.Stack, EndOfLine))
End If[/quote]

Do this instead :

If error <> Nil Then Dim type As String = Introspection.GetType(error).Name System.debuglog(type + EndOfLine + EndOfLine + Join(error.Stack, EndOfLine)) End If

That way the message will go into the messages area of the IDE that you reach by clicking the third icon under the central pane.

With some luck the program will have the time to display the stack before crashing.

That’s a crash, not an exception. It’s not going to call UnhandledException. It also explains why the debugger doesn’t just stop on the line that causes the exception. Submit a minidump with a feedback report.