AppleHelp.h / Carbon Call from Classic

AppleHelp.h / Carbon Call from Classic

Post by ccorbel » Fri, 09 Nov 2001 08:12:23



Hi,

I have two questions I hope someone can answer - either
answer will get me where I need to go but I'm curious about both.

The first is, in general, whether it's possible to call a
CarbonLib function from a pre-Carbon CFM app under 8.6+,
either directly or through some sort of shim library.
CW7 includes many examples for crossing the Mach-o/CFM call
boundary with a Carbon app but I've never seen an example
of crossing the pre-Carbon/Carbon boundary from a pre-Carbon
app known to be running in a Carbon-enabled OS version.
Can I call CarbonLib functions if I find CarbonLib present,
even if I didn't link against it?

The second question is, what's the easiest way to support Apple
Help Viewer online help from a pre-Carbon CFM app; the
AppleHelp.h functions aren't available.  I toyed with sending
an AppleScript command to the help viewer but didn't like the
results.  There are a couple examples in the SDK & Sample Code
of using some sort of Apple Guide voodoo but the examples
all focus on populating the help menu, which I'm not
concerned about - I just need to launch specific help
URL's in the help viewer in different contexts.

My app's Classic target is for MacOS 8.1 - 9; since we
need to support 8.1 CarbonLib isn't an option.  I really
want to avoid separate executables for 8.1 & 8.6+ if
it's possible (there will already be a separate executable
for 10.x).

In pre-8.6 I use Internet Config to launch a
web browser to view html help files; from 8.6-9.x I need
to launch the Help Viewer but the only examples I've found
use the AppleHelp.h methods.  

TIA for any help!
- Christopher

 
 
 

AppleHelp.h / Carbon Call from Classic

Post by meero » Fri, 09 Nov 2001 14:25:03




>The first is, in general, whether it's possible to call a
>CarbonLib function from a pre-Carbon CFM app under 8.6+,
>either directly or through some sort of shim library.

No. In order to call Carbon you must be Carbonized.

Quote:>CW7 includes many examples for crossing the Mach-o/CFM call
>boundary with a Carbon app but I've never seen an example
>of crossing the pre-Carbon/Carbon boundary from a pre-Carbon
>app known to be running in a Carbon-enabled OS version.
>Can I call CarbonLib functions if I find CarbonLib present,
>even if I didn't link against it?

No.

Quote:>The second question is, what's the easiest way to support Apple
>Help Viewer online help from a pre-Carbon CFM app; the
>AppleHelp.h functions aren't available.  I toyed with sending
>an AppleScript command to the help viewer but didn't like the
>results.  There are a couple examples in the SDK & Sample Code
>of using some sort of Apple Guide voodoo but the examples
>all focus on populating the help menu, which I'm not
>concerned about - I just need to launch specific help
>URL's in the help viewer in different contexts.

>In pre-8.6 I use Internet Config to launch a
>web browser to view html help files; from 8.6-9.x I need
>to launch the Help Viewer but the only examples I've found
>use the AppleHelp.h methods.  

The normal solution on older Mac OS is to lauch user's default browser
using the InternetConfig API, rather than trying to muck with the help
viewer. Is there a reason you insist on the help viewer?

meeroh
--
Hire me: <http://meeroh.org/hire.html>

 
 
 

AppleHelp.h / Carbon Call from Classic

Post by ccorbel » Sat, 10 Nov 2001 03:56:29


[.....]

Quote:> The normal solution on older Mac OS is to lauch user's default browser
> using the InternetConfig API, rather than trying to muck with the help
> viewer. Is there a reason you insist on the help viewer?

> meeroh
> --
> Hire me: <http://meeroh.org/hire.html>

A normal browser is not a help system.  I use IC and the web browser
for pre-8.6 but that isn't a very friendly solution.  It does not provide
indexing, searching by content, etc.  Help Viewer provides all of
this, not to mention the fact that it looks nicer and more professional
to the user.  It would be a shame to waste the Help Viewer available in
8.6-9.2, which aren't quite "older Mac OS" systems yet, especially in
the education market which my company targets.

I think I have a solution worked out that will allow the
non-Carbon app to trigger the carbon call through a high-level
shim, but this involves an additional helper application (which
I'll probably hide in App Support).  I was just hoping this problem
would have been handled more elegantly by someone...

Thanks for feedback,
Christopher

 
 
 

AppleHelp.h / Carbon Call from Classic

Post by meero » Sat, 10 Nov 2001 04:49:32




>A normal browser is not a help system.  I use IC and the web browser
>for pre-8.6 but that isn't a very friendly solution.  It does not provide
>indexing, searching by content, etc.  Help Viewer provides all of
>this, not to mention the fact that it looks nicer and more professional
>to the user.  It would be a shame to waste the Help Viewer available in
>8.6-9.2, which aren't quite "older Mac OS" systems yet, especially in
>the education market which my company targets.

Sure. That's a reasonable argument. I just wanted to know what the
argument was.

Quote:>I think I have a solution worked out that will allow the
>non-Carbon app to trigger the carbon call through a high-level
>shim, but this involves an additional helper application (which
>I'll probably hide in App Support).  I was just hoping this problem
>would have been handled more elegantly by someone...

That's actually a pretty neat solution, if all you need is launch the
viewer. You won't be able to add to your help menu from the helper app,
of course, just launch the viewer?

meeroh
--
Hire me: <http://meeroh.org/hire.html>