Installation of the Microsoft HTML Help SDK

Installation of the Microsoft HTML Help SDK

The HTMLHelp SDK is not provided with Visual Studio, at least not version 6. So if you have not installed it separately then you need to, as described in Installing HTML Help. Then look at my Introduction to HTMLHelp article if you need help getting started writing HTML Help files. Then set up the VC environment as described in Including HTML Help Support Files in an Application.

Program Modifications

The following is my version of how to modify a MFC application to use HTMLHelp.

Modifying the Resources

First create string resources to be used as prompts for the menus. Add the following ids with these strings or whatever other strings you choose. The resource editor will probably use the correct “Value” so you should not need to be concerned about that. I don’t know if it matters whether the exact values I show here must be used. Also it is probably not necessary to use all 6, probably only ID_HELP_CONTENTS, ID_HELP_INDEX and ID_HELP_SEARCH are necessary.
Display the Index of the Help file\nDisplay Index
List Help topics\nHelp Topics
Display instructions about how to use help\nHelp
Shows the help file
Display the Search tab of the Help file\nDisplay Search
Display the Table of Contents of the Help file\nDisplay Contents
Next add the following to a menu: ID_HELP_CONTENTS, ID_HELP_INDEX and ID_HELP_SEARCH. It is necessary to add them to a menu first since otherwise they will not be available in the ClassWizard to add handlers for them.

Modifying the Application

In your application’s InitInstance add the following so that the help file path and filename are set automatically. This assumes that your chm file is the same filename as your exe file except with a chm extension instead of the exe extension. It should also be in the same directory. That is the convention MFC uses and the following will just change the extension from hlp to chm. Next this code verifies that the chm file exists.

	CString strHelpFile = m_pszHelpFilePath;
if (strHelpFile.Right(4) == ".hlp") {
	strHelpFile = strHelpFile.Left(strHelpFile.GetLength()-4) + ".chm";
	m_pszHelpFilePath = _tcsdup(strHelpFile);
CFileStatus FileStatus;
if (!CFile::GetStatus(m_pszHelpFilePath, FileStatus)) {
	CString Message("Help file not found:\r\n");
	return FALSE;		// Optional; this can be removed
Modifying CMainFrame

Use ClassWizard to add handlers for ID_HELP_CONTENTS, ID_HELP_INDEX and ID_HELP_SEARCH then modify them as follows. I don’t know where I got the following code for OnHelpSearch from and I am not sure what it does. I should get answers to both those questions.

void CMainFrame::OnHelpContents() {
HWND hWnd = HtmlHelp(0, AfxGetApp()->m_pszHelpFilePath, HH_DISPLAY_TOC, NULL);
void CMainFrame::OnHelpIndex() {
HWND hWnd = HtmlHelp(0, AfxGetApp()->m_pszHelpFilePath, HH_DISPLAY_INDEX, NULL);
void CMainFrame::OnHelpSearch() {
memset(&q, 0, sizeof(HH_FTS_QUERY));
q.cbStruct = sizeof(HH_FTS_QUERY);
q.fUniCodeStrings = FALSE;
q.pszSearchQuery = "";
q.fStemmedSearch = FALSE;
q.fTitleOnly = FALSE;
q.fExecute = TRUE;
q.pszWindow = NULL;
HWND hWnd = HtmlHelp(0, AfxGetApp()->m_pszHelpFilePath, HH_DISPLAY_SEARCH, (DWORD)&q);

Then use ClassWizard again to override WinHelp, which is a virtual function, and then modify it as follows.

void CMainFrame::WinHelp(DWORD dwData, UINT nCmd) {
HWND hWnd = HtmlHelp(m_hWnd, AfxGetApp()->m_pszHelpFilePath, nCmd, dwData);
Custom Build Step

It is very convenient to have a custom build step for your chm file so that if you change it then it gets copied from wherever it is put by the HTMLHelp compiler to your project’s output directory (Debug or Release or whatever) automatically. By using a custom build step, this copy is done whenever you do a build of your VC project but only if the chm file has been changed. To create a custom build step for the help file, first add the file to the project. Then create the custom build step by using the “Custom Build Step” of the project settings. Select the chm file in the tree on the left then enter the following:


Copying $(InputPath)
copy $(InputPath) $(OutDir)\$(InputName).chm

“Installation of the Microsoft HTML Help SDK”의 143개의 댓글

  1. Wow, wonderful blog layout! How long have
    you been blogging for? you make blogging
    look easy. The overall look of your website is wonderful,
    let alone the content!

  2. I just want to mention I’m very new to blogging and site-building and actually liked this website. Likely I’m likely to bookmark your site . You definitely have exceptional article content. With thanks for sharing your web site.

  3. On this very topic, I try update my blogs almost like I’m speaking to somebody or talking to that reader directly as I consider it helps engage people a lot more than writing content formally especially when my own blog is based around the goings ons, daily thoughts and research about this somewhat controversial concern. I discovered that I nonetheless need to use more of the methods you have mentioned in this posting.

  4. Oh my goodness! a fantastic article dude. Thank you Nevertheless I am experiencing problem with ur rss. Don?t know why Incapable to subscribe to it. Exists any individual getting similar rss problem? Anybody who recognizes kindly respond. Thnkx

  5. One more thing. In my opinion that there are many travel insurance web sites of reputable companies than enable you to enter your holiday details and have you the quotes. You can also purchase the actual international travel insurance policy on-line by using your credit card. All that you should do will be to enter your current travel specifics and you can see the plans side-by-side. Simply find the package that suits your capacity to pay and needs after which use your bank credit card to buy the idea. Travel insurance on the web is a good way to start looking for a respectable company to get international travel cover. Thanks for expressing your ideas.

  6. I?m pleased, I have to claim. Truly rarely do I encounter a blog that?s both educative and also amusing, and let me tell you, you have actually hit the nail on the head. Your idea is impressive; the problem is something that insufficient individuals are speaking wisely around. I am very satisfied that I came across this in my search for something associating with this.

  7. Can I simply state what an alleviation to discover someone who in fact recognizes what theyre speaking about on the net. You certainly understand how to bring a problem to light and make it crucial. Even more individuals need to read this and comprehend this side of the story. I angle think youre not more popular because you most definitely have the gift.

  8. I found your blog website on google as well as inspect a few of your early messages. Continue to maintain the great run. I simply extra up your RSS feed to my MSN Information Viewers. Looking for forward to finding out more from you in the future!?

  9. The next time I review a blog site, I hope that it does not dissatisfy me as long as this set. I suggest, I recognize it was my selection to read, but I really thought youd have something fascinating to claim. All I hear is a bunch of yawping regarding something that you can take care of if you werent too hectic looking for attention.

  10. I?d have to check with you right here. Which is not something I normally do! I take pleasure in reviewing an article that will certainly make individuals believe. Additionally, many thanks for enabling me to comment!

  11. The following time I check out a blog site, I wish that it does not dissatisfy me as high as this set. I mean, I know it was my selection to review, but I really assumed youd have something intriguing to claim. All I listen to is a lot of whining about something that you can deal with if you werent as well hectic trying to find focus.

  12. When I originally commented I clicked the -Inform me when brand-new remarks are added- checkbox and also now each time a remark is added I get 4 e-mails with the exact same remark. Exists any way you can remove me from that service? Thanks!

  13. An impressive share, I simply provided this onto a colleague that was doing a little evaluation on this. And he actually purchased me morning meal because I found it for him. smile. So let me reword that: Thnx for the reward! However yeah Thnkx for investing the time to discuss this, I feel strongly about it and also like reading more on this topic. Ideally, as you become experience, would you mind upgrading your blog with more information? It is highly helpful for me. Large thumb up for this article!

  14. Can I just state what an alleviation to discover somebody that in fact recognizes what theyre talking about on the internet. You most definitely recognize exactly how to bring an issue to light and make it vital. Even more individuals need to read this and also understand this side of the story. I cant believe youre not extra preferred because you absolutely have the present.

  15. Oh my goodness! a fantastic post man. Thanks Nevertheless I am experiencing concern with ur rss. Don?t recognize why Incapable to sign up for it. Is there anybody obtaining the same rss issue? Any individual that knows kindly respond. Thnkx

  16. I blog quite often and I genuinely thank you for your information. This article
    has really peaked my interest. I am going to bookmark your site and keep checking for new details about once per week.

    I subscribed to your Feed as well.

  17. Can I simply say what a relief to discover someone that in fact understands what theyre discussing online. You certainly understand just how to bring a concern to light and also make it crucial. Even more individuals need to read this as well as understand this side of the tale. I cant believe youre not extra prominent due to the fact that you most definitely have the gift.

  18. What’s Taking place i’m new to this, I stumbled upon this I have found It positively helpful and it has aided me out loads. I hope to give a contribution & help other users like its helped me. Good job.

  19. This is the appropriate blog for anyone that wants to discover this subject. You understand so much its virtually tough to say with you (not that I really would want?HaHa). You definitely placed a new spin on a subject thats been covered for many years. Great stuff, just wonderful!

  20. When I originally commented I clicked the -Inform me when new remarks are added- checkbox as well as now each time a comment is included I obtain 4 emails with the very same remark. Is there any way you can remove me from that service? Thanks!

  21. I just want to tell you that I am just all new to blogs and actually liked you’re page. Very likely I’m planning to bookmark your site . You absolutely come with impressive articles and reviews. Thanks a lot for revealing your web page.

  22. certainly like your web-site however you have to test the spelling on several of your posts. Several of them are rife with spelling problems and I in finding it very troublesome to inform the reality however I will definitely come back again.

  23. I just want to say I am just newbie to blogs and actually enjoyed this blog site. More than likely I’m going to bookmark your blog post . You actually come with really good posts. Appreciate it for revealing your web-site.

  24. I’ve been exploring for a little for any high-quality articles or blog posts on this kind of area . Exploring in Yahoo I at last stumbled upon this web site. Reading this info So i am happy to convey that I have a very good uncanny feeling I discovered just what I needed. I most certainly will make certain to do not forget this web site and give it a look regularly.

  25. Do you have a spam problem on this website; I also am a blogger, and I was wondering your situation; we have developed some nice procedures and we are looking to trade strategies with other folks, why not shoot me an e-mail if interested.

  26. What i don’t realize is actually how you’re not really much more well-liked than you might be right now. You’re very intelligent. You realize therefore significantly relating to this subject, made me personally consider it from numerous varied angles. Its like women and men aren’t fascinated unless it’s one thing to accomplish with Lady gaga! Your own stuffs great. Always maintain it up!

  27. One important issue is that if you find yourself searching for a education loan you may find that you will want a co-signer. There are many situations where this is correct because you will find that you do not have a past credit rating so the loan company will require that you have someone cosign the financing for you. Interesting post.

  28. Thanks a lot for giving everyone an extraordinarily superb possiblity to read critical reviews from this website. It is usually so excellent and also stuffed with amusement for me personally and my office mates to visit your blog particularly three times weekly to study the fresh things you have. And definitely, I am also always amazed with all the cool guidelines served by you. Selected 3 facts on this page are undoubtedly the most efficient we have all had.

  29. Along with the budget and special effects, or to be more accurate, more importantly then the technical elements, Star Trek pulsates with life and the human element thanks to a superb ensemble cast.

  30. There couple of intriguing points in time in the following paragraphs but I don’t know if these center to heart. There’s some validity but I’ll take hold opinion until I look into it further. Great write-up , thanks and we want a lot more! Added onto FeedBurner also

  31. I just want to say I am just all new to blogs and honestly liked your web blog. Almost certainly I’m want to bookmark your website . You really have impressive article content. Thanks a lot for sharing your web site.

  32. This is a appropriate blog for anybody who desires to find out about this topic. You understand a great deal its almost not easy to argue with you (not that I really would want…HaHa). You certainly put a fresh spin for a topic thats been discussed for years. Excellent stuff, just wonderful!

  33. Can I simply say what a comfort to discover an individual who actually knows what they are discussing on the net. You actually know how to bring a problem to light and make it important. A lot more people really need to look at this and understand this side of your story. It’s surprising you are not more popular because you definitely possess the gift.

  34. Hello there! This post could not be written much better! Going through this post reminds me of my previous roommate! He continually kept talking about this. I most certainly will forward this information to him. Fairly certain he will have a very good read. Thanks for sharing!

  35. I am curious to find out what blog platform you are utilizing? I’m experiencing some minor security issues with my latest site and I’d like to find something more secure. Do you have any recommendations?

  36. hello there and thanks for your information – I have definitely picked up something new from right here. I did alternatively expertise several technical points the usage of this web site, as I experienced to reload the website lots of times previous to I may just get it to load correctly. I had been pondering if your web hosting is OK? Not that I am complaining, but slow loading instances times will very frequently have an effect on your placement in google and can harm your quality ranking if advertising and ***********|advertising|advertising|advertising and *********** with Adwords. Anyway I’m adding this RSS to my e-mail and could glance out for a lot more of your respective fascinating content. Make sure you update this again very soon..

  37. Thanks for making the honest attempt to speak about this. I believe very robust approximately it and want to read more. If it’s OK, as you gain more in depth wisdom, would you thoughts adding extra articles similar to this one with additional information? It might be extremely useful and useful for me and my friends.Venessa Smidt

  38. I absolutely love your blog.. Very nice colors & theme. Did you create this website yourself? Please reply back as I’m wanting to create my own personal blog and would like to learn where you got this from or just what the theme is named. Thanks!

  39. Have you ever thought about including a little bit more than just your articles? I mean, what you say is valuable and all. But think of if you added some great photos or video clips to give your posts more, “pop”! Your content is excellent but with images and video clips, this blog could certainly be one of the greatest in its field. Wonderful blog!

  40. Do you have a spam issue on this website; I also am a blogger, and I was curious about your situation; many of us have developed some nice practices and we are looking to trade solutions with others, why not shoot me an email if interested.

  41. After I originally commented I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I recieve 4 emails with the exact same comment. There has to be a way you are able to remove me from that service? Thanks.

  42. There are definitely numerous details like that to take into consideration. That may be a great point to bring up. I offer the ideas above as basic inspiration but clearly there are questions like the one you bring up the place crucial thing will likely be working in honest good faith. I don?t know if greatest practices have emerged round issues like that, but I’m sure that your job is clearly recognized as a good game. Each girls and boys really feel the affect of only a second’s pleasure, for the remainder of their lives.

  43. I’ll right away snatch your rss as I can not to find your email subscription link or newsletter service. Do you’ve any? Kindly allow me recognise so that I could subscribe. Thanks.

  44. I have learned several important things as a result of your post. I might also like to state that there is a situation that you will obtain a loan and never need a co-signer such as a U.S. Student Aid Loan. However, if you are getting that loan through a conventional creditor then you need to be willing to have a co-signer ready to assist you to. The lenders will certainly base that decision over a few elements but the most important will be your credit rating. There are some loan providers that will as well look at your work history and choose based on this but in many instances it will depend on your scores.

  45. I do enjoy the manner in which you have presented this difficulty plus it does indeed supply me personally some fodder for thought. On the other hand, from what I have experienced, I only hope as other feed-back pile on that men and women keep on point and don’t get started on a tirade of some other news of the day. Still, thank you for this excellent piece and even though I can not go along with it in totality, I respect your standpoint.

  46. Thank you for each of your hard work on this site. My mum really likes managing investigations and it is obvious why. Almost all notice all of the powerful tactic you give advantageous strategies by means of this website and cause response from other people about this idea so our simple princess is undoubtedly being taught a great deal. Take advantage of the remaining portion of the year. You’re conducting a stunning job.

  47. I know this if off topic but I’m looking into starting my own blog and was wondering what all is needed to get setup? I’m assuming having a blog like yours would cost a pretty penny? I’m not very internet savvy so I’m not 100 certain. Any tips or advice would be greatly appreciated. Thanks

  48. There are certainly a lot of details like that to take into consideration. That is a nice level to deliver up. I supply the thoughts above as normal inspiration but clearly there are questions like the one you bring up the place a very powerful factor will probably be working in sincere good faith. I don?t know if greatest practices have emerged around issues like that, however I’m positive that your job is clearly recognized as a fair game. Both boys and girls feel the influence of only a second’s pleasure, for the remainder of their lives.

  49. Can I just say what a comfort to uncover an individual who genuinely understands what they’re talking about online. You definitely realize how to bring a problem to light and make it important. More people really need to look at this and understand this side of the story. I was surprised you’re not more popular since you certainly possess the gift.

  50. Nearly all of what you articulate happens to be supprisingly legitimate and that makes me wonder why I had not looked at this with this light before. This particular piece truly did turn the light on for me personally as far as this issue goes. But there is actually one position I am not necessarily too comfortable with so while I make an effort to reconcile that with the central theme of the point, allow me see what the rest of the readers have to point out.Nicely done.

  51. I do love the way you have framed this particular issue plus it really does supply me personally some fodder for consideration. However, coming from what precisely I have personally seen, I just trust as the actual comments stack on that individuals remain on point and don’t embark upon a tirade of some other news of the day. All the same, thank you for this fantastic point and though I can not agree with this in totality, I regard the viewpoint.

  52. I loved as much as you’ll receive carried out right here. The sketch is tasteful, your authored subject matter stylish. nonetheless, you command get bought an nervousness over that you wish be delivering the following. unwell unquestionably come more formerly again as exactly the same nearly a lot often inside case you shield this increase.

  53. Attractive element of content. I simply stumbled upon your site and in accession capital to assert that I get in fact enjoyed account your blog posts. Any way I’ll be subscribing for your augment and even I success you access constantly fast.

  54. Have you ever thought about including a little bit more than just your articles? I mean, what you say is important and everything. Nevertheless think about if you added some great photos or video clips to give your posts more, “pop”! Your content is excellent but with images and clips, this blog could undeniably be one of the most beneficial in its field. Wonderful blog!

  55. Thanks a lot for providing individuals with a very breathtaking possiblity to check tips from this web site. It’s usually very pleasant and also full of a great time for me and my office peers to search your web site nearly three times per week to find out the new tips you have got. And definitely, I am just usually fascinated considering the great suggestions served by you. Some 4 ideas in this posting are in truth the best I’ve had.

  56. The very heart of your writing whilst appearing reasonable at first, did not really work perfectly with me personally after some time. Someplace throughout the paragraphs you were able to make me a believer but just for a while. I nevertheless have a problem with your jumps in assumptions and you might do well to help fill in those gaps. In the event that you actually can accomplish that, I would surely end up being fascinated.

  57. Hello! Someone in my Myspace group shared this site with us so I came to look it over. I’m definitely enjoying the information. I’m bookmarking and will be tweeting this to my followers! Terrific blog and excellent style and design.

  58. Pretty nice post. I just stumbled upon your blog and wanted to say that I’ve truly enjoyed surfing around your blog posts. In any case I will be subscribing to your rss feed and I hope you write again very soon!

  59. Youre so cool! I dont suppose Ive learn something like this before. So nice to search out any individual with some authentic thoughts on this subject. realy thank you for starting this up. this website is something that’s needed on the web, someone with somewhat originality. useful job for bringing something new to the web!

  60. Throughout the great design of things you actually get a B- for hard work. Exactly where you actually lost everybody ended up being in your particulars. You know, people say, details make or break the argument.. And that could not be more true at this point. Having said that, allow me say to you what exactly did deliver the results. The writing is definitely quite engaging which is probably the reason why I am taking an effort in order to opine. I do not make it a regular habit of doing that. Secondly, despite the fact that I can notice the leaps in reasoning you make, I am not really certain of just how you appear to unite your points that help to make your conclusion. For the moment I will yield to your point however trust in the foreseeable future you actually connect your facts much better.

  61. I haven’t checked in here for some time as I thought it was getting boring, but the last few posts are good quality so I guess I’ll add you back to my everyday bloglist. You deserve it my friend 🙂

  62. Hmm it appears like your website ate my first comment (it was extremely long) so I guess I’ll just sum it up what I wrote and say, I’m thoroughly enjoying your blog. I as well am an aspiring blog writer but I’m still new to everything. Do you have any recommendations for newbie blog writers? I’d certainly appreciate it.

  63. Unquestionably believe that which you stated. Your favourite reason appeared to be at the web the easiest thing to have in mind of. I say to you, I certainly get annoyed whilst folks think about issues that they just don’t know about. You controlled to hit the nail upon the highest as smartly as outlined out the whole thing with no need side-effects , people can take a signal. Will likely be again to get more. Thank you

댓글 남기기