Cocoa Lib missing

Trying to use the following declare alone so I can remove masoslib from my project as this is the only declare I want.

[code] declare sub setTitleWithRepresentedFilename lib CocoaLib selector “setTitleWithRepresentedFilename:” (id as Ptr, filePath as CFStringRef)

  setTitleWithRepresentedFilename Ptr(w.Handle), f.POSIXPath[/code]

When I run the project in the IDE, I get the message that the CocoaLib is missing. This is a Cocoa build. I would have thought that the CocoaLib would be included. What am I not understanding.

P.S. I’m trying to remove masoslib because I was getting errors in my Win build that the CocoaLib could not be loaded.

Try

declare sub setTitleWithRepresentedFilename lib “Cocoa” selector “setTitleWithRepresentedFilename:” (id as Ptr, filePath as
CFStringRef)

CocoaLib is likely a constant. Check the original project to see what its value is and use that.

Christoph: When I use

declare sub setTitleWithRepresentedFilename lib "Cocoa" selector "setTitleWithRepresentedFilename:" (id as Ptr, filePath asCFStringRef)

I get a syntax error. I tried removing the quotes around Cocoa, but that also did not work. Other than that, the line is the same as the previous try.
Paul: When I check masOSLib, I see CocoaLib As String = Cocoa.framework. So I tried

declare sub setTitleWithRepresentedFilename lib "Cocoa.framework" selector "setTitleWithRepresentedFilename:" (id as Ptr, f as CFStringRef) which compiled but did not produce the file icon in the Window Title. Adding the 2nd line

setTitleWithRepresentedFilename Ptr(w.Handle), filepath.POSIXPath

Produced a “This item does not exist” error.
I am really lost in the desert here. Help much appreciated

should be filePath.nativePath

[quote=225625:@Roger Clary]When I use
declare sub setTitleWithRepresentedFilename lib “Cocoa” selector “setTitleWithRepresentedFilename:” (id as Ptr, filePath asCFStringRef)
I get a syntax error.[/quote]
asCFStringRef should be as CFStringRef

[code] #if targetCocoa
dim f As FolderItem = gCurQuiz.getCurQuizPath()
if f <> Nil and f.Exists Then

  declare sub setTitleWithRepresentedFilename lib "Cocoa.framework" selector "setTitleWithRepresentedFilename:" (id as Ptr, filepath as CFStringRef)
  setTitleWithRepresentedFilename Ptr(w.Handle), f.NativePath
  
end if

#endif[/code]
Worked as desired producing the file icon in front of the Window Title.
Thanks to all who responded.