Hello,
I am having a problem when f is nil in “DocumentFile(extends w as Window, assigns f as FolderItem)” the code for it seems to have been omitted…
DocumentFile(extends w as Window, assigns f as FolderItem)
if w.Handle = 0 then
return
end if
#if targetCarbon
if f is nil then
declare function RemoveWindowProxy lib CarbonLib (inWindow as WindowPtr) as Integer
dim OSError as Integer = RemoveWindowProxy(w)
else
declare function FSNewAlias lib CarbonLib (fromFile as Ptr, fsRef as Ptr, ByRef inAlias as Ptr) as Short
dim aliasHandle as Ptr
dim fileRef as FSRef = FileManager.GetFSRefFromFolderItem(f)
dim OSError as Integer = FSNewAlias(nil, fileRef, aliasHandle)
if OSError <> 0 then
return
end if
declare function SetWindowProxyAlias lib CarbonLib (inWindow as WindowPtr, inAlias as Ptr) as Integer
OSError = SetWindowProxyAlias(w, aliasHandle)
if aliasHandle <> nil then
soft declare sub DisposeHandle lib CarbonLib (h as Ptr)
DisposeHandle aliasHandle
aliasHandle = nil
end if
end if
#endif
#if targetCocoa
declare sub setTitleWithRepresentedFilename lib CocoaLib selector “setTitleWithRepresentedFilename:” (id as Ptr, filePath as CFStringRef)
setTitleWithRepresentedFilename Ptr(w.Handle), f.POSIXPath
#endif
How can I fix it?
Thanks.
Lennox