Discussion:
#hash possible?
(too old to reply)
hls
2009-07-10 18:39:02 UTC
Permalink
There is probably a simple way for this. Maybe an alternative
approach can be suggested.

In this CHM help project, I am documenting a GUI application using:

- HELP button to display the DIALOG page help

Image of DIALOG

Follow with each Field description

- Context-sensitive help (? icon)

In other to reduce duplicate work, I want to use the main help page
with #hash targets for the context sensitive help.

For example, the main help has:

<img srg="images/dialog1.png" border="0"/>

<h3><a name="field1">field1</a></h3>
<p>...text...</p>

<h3><a name="field2">field2</a></h3>
<p>...text...</p>

...

<h3><a name="fieldN">fieldN</a></h3>
<p>...text...</p>

Is there a way via C/C++ HtmlHelp calls to use a # URL to the target
field?

Right now, I have it outline so that each field has its own HTM page.
They are currently empty. This will save me time of now having to
duplicate the text. I don't think HTMLHELP compiler supports include
files? No?

Thanks

--
Rob Chandler [MVP]
2009-07-11 03:43:56 UTC
Permalink
Hi again

You can certainly put anchors in a HTML topic file, then your TOC, Index or
App can jump to these locations.

So this should work...

If topic Intro.htm contains bookmark called mybookmark

<a name="mybookmark"></a>

HtmlHelp(0, "c:\Help.chm::/Intro.htm#mybookmark", HH_DISPLAY_TOPIC, 0);
HtmlHelp(0, "c:\Help.chm::/Intro.htm#mybookmark>Mainwin", HH_DISPLAY_TOPIC,
0);

MS did not pay very close attention to Bookmarks when creating Help 1.x.
So Bookmarks can be a problem...

* You can't make your Search Results Jump to a Bookmark.
Although you can create dummy page that redirects the user to a bookmark.

* If you have a Merged Help system (several Help files) then jumping to
bookmarks in slave CHMs wont work unless you use some tricks.
See http://helpware.net/htmlhelp/how_to_merge_ctx2.htm

If you are using Context calls like

HtmlHelp(0, "c:\Help.chm", HH_HELP_CONTEXT, 1001);

then the book marks can be embedded in the HHP project file.
But again if you have Merged help then you need some tricks
See http://helpware.net/htmlhelp/how_to_merge_ctx2.htm
I don't think HTMLHELP compiler supports include files? No?
If I understand you.. No! But as I say (above) bookmarks in most
cases work ok in HTML.

Back to you
Rob
MS Help MVP
http://helpware.net/FAR/
There is probably a simple way for this. Maybe an alternative approach
can be suggested.
- HELP button to display the DIALOG page help
Image of DIALOG
Follow with each Field description
- Context-sensitive help (? icon)
In other to reduce duplicate work, I want to use the main help page with
#hash targets for the context sensitive help.
<img srg="images/dialog1.png" border="0"/>
<h3><a name="field1">field1</a></h3>
<p>...text...</p>
<h3><a name="field2">field2</a></h3>
<p>...text...</p>
...
<h3><a name="fieldN">fieldN</a></h3>
<p>...text...</p>
Is there a way via C/C++ HtmlHelp calls to use a # URL to the target
field?
Right now, I have it outline so that each field has its own HTM page. They
are currently empty. This will save me time of now having to duplicate the
text. I don't think HTMLHELP compiler supports include files? No?
Thanks
--
hls
2009-07-13 09:39:38 UTC
Permalink
This post might be inappropriate. Click to display it.
Ulrich Kulle [MVP]
2009-07-13 20:15:42 UTC
Permalink
Hello hls (Mike),

I'm not going through the complete thread (very busy with my job) - but my answer from last week had a link.
http://www.help-info.de/en/Help_Info_HTMLHelp/hh_context-id.htm
Please search for the headline "Anchor in the middle of the topic (see below too):" and read the tips. But note - this means
renaming the CHM will break the alias!

You may be interested in Sid Penstone's tool and some tips on my site:
http://www.help-info.de/en/Help_Info_WinHelp/hw_converting.htm#Tips
--
Best regards
Ulrich Kulle
Microsoft MVP - Help
***********************************
http://www.help-info.de
***********************************
Post by hls
Hi Rob,
Here is what I have, from the old school WinHelp system, the HLP to HPP converter created all these individual
html\wcss####.HTM files.
Over 20 or so projects, at this point, we got maybe 5 or so which over to CHM.
To help automatic the integration with the applet, I wrote a C/C++ utility to parse the *.HTM files to create an alias file,
HIDC_SSL_VERLEVEL=html\wcss2crw.htm ; Verify Level
HIDC_SSL_ENABLED=html\wcss2ko4.htm ; Enable SSL
HIDC_SSL_DEBUGLEVEL=html\wcss312k.htm ; Debug level
HIDC_SSL_CIPHER=html\wcss8dde.htm ; Cipher Suite
HIDD_SSL_ADVANCED=html\wcssl_server_options.htm ; wcSSL Server Options
etc...
A #define wcsslConfig-topics.h file is also created by reading the resource.h file to match the HIDy_xxxxxxxxx with the
resource id.
I had it so the
HIDD_ are based HID_BASE_RESOURCE (0x2000) (dialogs)
HIDC_ are based HID_BASE_COMMAND (0x1000) (controls)
So now have have a [HELP] button dialog page display for the HIDD_ items, and context-sensitive help for the HIDC_ control
items.
Now in this example able, the HIDD_ file is a dialog help with all the fields documented. In other words, I have all the
content of each field in the html\wcssl_server_options.htm file.
HIDC_SSL_CIPHER=html\html\wcssl_server_options.htm#cipher
That HPP compiler doesn't like this, it thinks it a file.
I guess, I can create a C/C++ collection map with the utility that will be compiled into the applet.
BOOL CHostSSLTreeManager::OnHelpInfo(HELPINFO* pHelpInfo)
{
DWORD dwHid = pHelpInfo->iCtrlId | HID_BASE_COMMAND;
// current way
//HtmlHelp(NULL /*m_hWnd*/,"wcsslConfig.chm",HH_HELP_CONTEXT,dwHid);
// new idea for html hash
CString hash = HashHelpMap[dwHid]; // get hash
HtmlHelp(NULL,
"wcsslConfig.chm",
HH_DISPLAY_TOPIC,
(DWORD)(char*)hash);
return TRUE;
}
I tested this with a hard code, so it will work by creating a map.
What do you think?
--
Post by Rob Chandler [MVP]
Hi again
You can certainly put anchors in a HTML topic file, then your TOC, Index or App can jump to these locations.
So this should work...
If topic Intro.htm contains bookmark called mybookmark
<a name="mybookmark"></a>
HtmlHelp(0, "c:\Help.chm::/Intro.htm#mybookmark", HH_DISPLAY_TOPIC, 0);
HtmlHelp(0, "c:\Help.chm::/Intro.htm#mybookmark>Mainwin", HH_DISPLAY_TOPIC, 0);
MS did not pay very close attention to Bookmarks when creating Help 1.x.
So Bookmarks can be a problem...
* You can't make your Search Results Jump to a Bookmark.
Although you can create dummy page that redirects the user to a bookmark.
* If you have a Merged Help system (several Help files) then jumping to
bookmarks in slave CHMs wont work unless you use some tricks.
See http://helpware.net/htmlhelp/how_to_merge_ctx2.htm
If you are using Context calls like
HtmlHelp(0, "c:\Help.chm", HH_HELP_CONTEXT, 1001);
then the book marks can be embedded in the HHP project file.
But again if you have Merged help then you need some tricks
See http://helpware.net/htmlhelp/how_to_merge_ctx2.htm
I don't think HTMLHELP compiler supports include files? No?
If I understand you.. No! But as I say (above) bookmarks in most
cases work ok in HTML.
Back to you
Rob
MS Help MVP
http://helpware.net/FAR/
There is probably a simple way for this. Maybe an alternative approach can be suggested.
- HELP button to display the DIALOG page help
Image of DIALOG
Follow with each Field description
- Context-sensitive help (? icon)
In other to reduce duplicate work, I want to use the main help page with #hash targets for the context sensitive help.
<img srg="images/dialog1.png" border="0"/>
<h3><a name="field1">field1</a></h3>
<p>...text...</p>
<h3><a name="field2">field2</a></h3>
<p>...text...</p>
...
<h3><a name="fieldN">fieldN</a></h3>
<p>...text...</p>
Is there a way via C/C++ HtmlHelp calls to use a # URL to the target field?
Right now, I have it outline so that each field has its own HTM page. They are currently empty. This will save me time of
now having to duplicate the text. I don't think HTMLHELP compiler supports include files? No?
Thanks
--
hls
2009-07-13 20:38:49 UTC
Permalink
Thanks, I didn't know you can ignore the compiler warning. It works now!

IDH_30000=CHM-example.chm::/HTMLH
Post by Ulrich Kulle [MVP]
Hello hls (Mike),
I'm not going through the complete thread (very busy with my job) - but
my answer from last week had a link.
http://www.help-info.de/en/Help_Info_HTMLHelp/hh_context-id.htm
Please search for the headline "Anchor in the middle of the topic (see
below too):" and read the tips. But note - this means renaming the CHM
will break the alias!
http://www.help-info.de/en/Help_Info_WinHelp/hw_converting.htm#Tips
Rob Chandler [MVP]
2009-07-15 02:56:41 UTC
Permalink
Hi Mike
Yes. So I think knowing that fact your solution should be ok.
I have compile errors in my log as well, but my output is a clean CHM.

The only comment from me (again) is if you merge CHMs then
you need to use those tricks mentioned to jump to
the bookmarks (aka Anchors) within a topic.

Rob

PS. The MVPs often share the task of helping others in the
group. Which I find very helpful since we can give the community
24 hr support. We are all in different time zones.
eg. Ulrich is in Germany GMT+2; I'm in Australia GMT+10
Post by hls
Thanks, I didn't know you can ignore the compiler warning. It works now!
IDH_30000=CHM-example.chm::/HTMLH
Post by Ulrich Kulle [MVP]
Hello hls (Mike),
I'm not going through the complete thread (very busy with my job) - but
my answer from last week had a link.
http://www.help-info.de/en/Help_Info_HTMLHelp/hh_context-id.htm
Please search for the headline "Anchor in the middle of the topic (see
below too):" and read the tips. But note - this means renaming the CHM
will break the alias!
http://www.help-info.de/en/Help_Info_WinHelp/hw_converting.htm#Tips
Loading...