Hi List,

why would this code crash ?

It is handled from a Toolbar control in the window

Sub Action(item As ToolItem)
   if CardIsDirty Then
     if SaveCard Then

     Else
       Return
     end if
   end if

   Select Case item.Name
   case  "tbb_Clusters"
     App.MainBarHandler(Self,ClusterWindow)
     Self.Close
   case "tbb_CompCards"
     App.MainBarHandler(Self,CompetenceCards)
     Self.Close
   case  "tbb_ratings"
     App.MainBarHandler(Self,scorewindow)
     Self.Close
   case "tbb_ShowPrefs"
     PreferencesWindow.ShowModal
   end Select
End Sub

// Placed in App

Sub MainBarHandler(OldWindow As Window,NewWindow As Window)
   Dim i As Integer
   Dim OldLeft,OldTop,OldWidth,OldHeight As Integer


   For i = 0 to WindowCount
     if Window(i).Title = OldWindow.Title Then
       OldLeft = Window(i).Left
       OldTop = Window(i).Top
       OldWidth = Window(i).Width
       OldHeight = Window(i).Height
       Exit
     end if
   Next


   NewWindow .Left =OldLeft
   NewWindow .Top = OldTop
   NewWindow .Width = OldWidth
   NewWindow .Height = OldHeight

   OldWindow.Hide
   NewWindow .Show

End Sub

This code functions between 10 and 15 times clicking on a toolbaritem  
(doing nothing else)
Then it crashes.

I must say this is driving me nuts. I must be missing something  
fundamental when switching windows so any help much appreciated.


TIA

Bart Pietercil



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to