[futurebasic] Re: [FB] The file name returns zero part 2

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2011 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Sat, 22 Jan 2011 16:20:24 +1300
Yoshiyuki Hasegawa wrote:

> fn NavDialog_SetSaveFileName( cfName )
> fn NavDialog( _kNavDialogPutFile + _kNavDialogSheet, "Save This File As...", "", @fn MyPutFileHandler, 0 )
> //CFRelease( cfName ) // Not use function
> At present, the code above operates enough.
> 
> fn NavDialog_SetMessage( @"untitled.abcd" )
> or
> fn NavDialog_SetMessage( fn CFSTR( "untitled.abcd" ) )
> The code of the two above doesn't operates.

NavDialog_SetMessage() is ignored unless you pass a null Pascal string as the second parameter:
   fn NavDialog( _kNavDialogPutFile, "", "", @fn MyPutFileHandler, 0 )

Similarly, NavDialog_SetSaveFileName() is ignored unless you pass a null string as the third parameter.


> fn NavDialog_SetSaveFileName( cfName )
> fn NavDialog( _kNavDialogPutFile + _kNavDialogSheet, "Save This File As...", "", @fn MyPutFileHandler, 0 )
> CFRelease( cfName ) // Use function
> The application suddenly quits in the code above when the superscription saving (Replace) if CFRelease() is executed.
> Temporary cfName is made a global variable.

The crash should be fixed in FutureBasic 5.5, announced today.

> FBtoC bug-fixes
> ...
> 582  Error    NavDialog() releases saveFileName and message wrongly

Robert P.