DBKit bug workaround

If you place a non-user interface control on a window using DBKit, you’ll get an IllegalCastException at runtime when that window is opened. It’s fixed for the next beta but in the meantime, replace DBKit.TableConnection.ParentWindow with this revised version to fix the problem:

'Find the window this connector instance resides upon
For Each win As DesktopWindow In App.Windows
  For Each obj As Object In win.Objects
    If obj IsA DesktopContainer Then
      Return ParentWindow(DesktopContainer(obj))
    Else
      If obj IsA DBKit.TableConnection Then
        If Self = DBKit.TableConnection(obj) Then
          Return win
        End If
      End If
    End If
  Next
Next

Return Nil

This is already fixed for the next beta.

1 Like