[futurebasic] FB3 Build Windows Crash

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: Dabs@...
Date: Wed, 13 Oct 1999 00:44:17 EDT
Earlier I reported a problem building windows in a pg project.  The problem 
appeared to occur within the FN FBSetBestWindow function (called by the fb 
window function) in the runtime include.  With further testing I found that 
the problem occurs when an attempt is made to deactivate a text field when 
the field handle is actually _nil.  It occurs here.

BestField& = gFBWnd.ActEF&(actWnd)
long if gFBActField&
  long if BestField& <> gFBActField&
    WINDOW OUTPUT gFBBestWnd%
    teDeactivate(gFBActField&) ********* This is the offending call causing 
the crash
  end if
end if

This is the fix


BestField& = gFBWnd.ActEF&(actWnd)
long if gFBActField&
 long if BestField& <> gFBActField&
  WINDOW OUTPUT gFBBestWnd%
  IF gFBActField& <> 0 THEN teDeactivate(gFBActField&)  'check for _nil 
handle first
 end if
end if

Perhaps there is a better way to fix the problem???  

David