[futurebasic] Re: [FB] Help System

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2010 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Sat, 13 Feb 2010 14:52:57 -0500
On Feb 13, 2010, at 2:22 PM, Brian Heibert wrote:

> Hi,
>
> I checked my plist file and there are no help entries in it, that  
> is the way I want it
>
>
> I think I am missing my fn RegisterMyHelpBook
> Where can I find that FN
>
> //fn RegisterMyHelpBook

I think you've been given that at least 2 times in the past, but here  
it is again, I am not sure it is to spec, Slide Freebie is years out  
without an update.

I thus cannot offer any support on this function, when it fails to  
work. :) Or if it does.

rc

// AppleHelp.h
toolbox fn AHRegisterHelpBook( const FSRef * appBundleRef ) = OSStatus

// CFBundle.h
toolbox fn CFBundleGetMainBundle = CFBundleRef
toolbox fn CFBundleCopyBundleURL( CFBundleRef bundle ) = CFURLRef

// CFURL.h
toolbox fn CFURLGetFSRef( CFURLRef url, FSRef *fsRef) = Boolean


local mode
local fn RegisterMyHelpBook
'~'1
dim as CFBundleRef  myApplicationBundle
dim as CFURLRef     myBundleURL
dim as FSRef        myBundleRef
dim as OSStatus     ignore

myApplicationBundle = fn CFBundleGetMainBundle()
long if ( myApplicationBundle )
myBundleURL = fn CFBundleCopyBundleURL( myApplicationBundle )
long if ( myBundleURL)
long if ( fn CFURLGetFSRef( myBundleURL, @myBundleRef ) )
ignore = fn AHRegisterHelpBook( @myBundleRef )
Xelse
stop "CFURLGetFSRef Failed"
end if
CFRelease( myBundleURL )
Xelse
stop "Bundle URL Failed"
end if
xelse
stop "Help Bundle Failed"
end if
end fn