Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Winhelp vs. HTML help context

Winhelp vs. HTML help context

Scheduled Pinned Locked Moved C / C++ / MFC
csharpvisual-studiohelpc++html
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    digwizfox
    wrote on last edited by
    #1

    I have a bit of a problem and am not sure how serious it is. I'd appreciate any advice from the programming community here. A couple of months ago, we built a new MFC application using the MFC application wizard within Visual Studio .NET. I knew I wanted to implement a help system but wasn't really sure which one to use at the time. It was a low priority and we mainly just wanted to build the application and make it work first. Not having had much experience with MFC application development, we created the new application project to use winhelp. Now, after further review I've decided that we probably should have set it up to use HTML help. Is it a reasonable process to to manually change the code and files within the project directories? Has anyone ever had to do this? I'm wondering how much of a hassle it is going to be. If anyone has any insight on this or helplful tips, I'd appreciate it. Right now my plan is to create two new side by side projects one using each kind of help. Then I want to evaluate the files and directories created by the wizard to see what the differences are. Hopefully, I can go back to the original application directories and tweak the settings and files/directories to changeover to HTML help. If anyone knows of a better way let me know. If you think that what I am doing is correct and the only way; let me know that too. I'd appreciate any input. Thank you.

    G Y 2 Replies Last reply
    0
    • D digwizfox

      I have a bit of a problem and am not sure how serious it is. I'd appreciate any advice from the programming community here. A couple of months ago, we built a new MFC application using the MFC application wizard within Visual Studio .NET. I knew I wanted to implement a help system but wasn't really sure which one to use at the time. It was a low priority and we mainly just wanted to build the application and make it work first. Not having had much experience with MFC application development, we created the new application project to use winhelp. Now, after further review I've decided that we probably should have set it up to use HTML help. Is it a reasonable process to to manually change the code and files within the project directories? Has anyone ever had to do this? I'm wondering how much of a hassle it is going to be. If anyone has any insight on this or helplful tips, I'd appreciate it. Right now my plan is to create two new side by side projects one using each kind of help. Then I want to evaluate the files and directories created by the wizard to see what the differences are. Hopefully, I can go back to the original application directories and tweak the settings and files/directories to changeover to HTML help. If anyone knows of a better way let me know. If you think that what I am doing is correct and the only way; let me know that too. I'd appreciate any input. Thank you.

      G Offline
      G Offline
      Gary R Wheeler
      wrote on last edited by
      #2

      Since it sounds like you're a bit unfamiliar with MFC development, I think you're doing the right thing. Comparing the code the wizard generates for different choices will show you the basics on how different things are accomplished. Another thing you can do is to run the wizard again, creating an application with the same attributes as yours (single or multiple document, view types, etc.) and using the same file and class names, but selecting HTML help this time. You can then cut/paste the bits and pieces you need out of the wizard-generated code into your existing application.


      Software Zen: delete this;

      D 1 Reply Last reply
      0
      • D digwizfox

        I have a bit of a problem and am not sure how serious it is. I'd appreciate any advice from the programming community here. A couple of months ago, we built a new MFC application using the MFC application wizard within Visual Studio .NET. I knew I wanted to implement a help system but wasn't really sure which one to use at the time. It was a low priority and we mainly just wanted to build the application and make it work first. Not having had much experience with MFC application development, we created the new application project to use winhelp. Now, after further review I've decided that we probably should have set it up to use HTML help. Is it a reasonable process to to manually change the code and files within the project directories? Has anyone ever had to do this? I'm wondering how much of a hassle it is going to be. If anyone has any insight on this or helplful tips, I'd appreciate it. Right now my plan is to create two new side by side projects one using each kind of help. Then I want to evaluate the files and directories created by the wizard to see what the differences are. Hopefully, I can go back to the original application directories and tweak the settings and files/directories to changeover to HTML help. If anyone knows of a better way let me know. If you think that what I am doing is correct and the only way; let me know that too. I'd appreciate any input. Thank you.

        Y Offline
        Y Offline
        YoSilver
        wrote on last edited by
        #3

        I still use VS 6.0, but I guess my considerations could help. All you need is to redefine the CWinApp virtual function WinHelp. Then, define a CString member m_strHelpFilePath and put a full path to your .chm in it in CApp::InitInstance. (You can do something different, but the idea is to form and store the .chm path). Your WinHelp function might look like this:

        void CApp::WinHelp(DWORD dwData, UINT nCmd)
        {
        HWND hwndDesktop = ::GetDesktopWindow();

        if (!HtmlHelp(hwndDesktop, 
                      m\_strHelpFilePath, 
                      HH\_HELP\_CONTEXT, 
                      nCmd == HELP\_CONTEXT ? dwData : 0)))
        {
            HtmlHelp(hwndDesktop, m\_strHelpFilePath, HH\_HELP\_FINDER, 0);
        }
        

        }

        If you want your main frame to own the help window frame, pass m_pMainWnd->GetSafeHwnd() instead of hwndDesktop. Hope this helps.

        1 Reply Last reply
        0
        • G Gary R Wheeler

          Since it sounds like you're a bit unfamiliar with MFC development, I think you're doing the right thing. Comparing the code the wizard generates for different choices will show you the basics on how different things are accomplished. Another thing you can do is to run the wizard again, creating an application with the same attributes as yours (single or multiple document, view types, etc.) and using the same file and class names, but selecting HTML help this time. You can then cut/paste the bits and pieces you need out of the wizard-generated code into your existing application.


          Software Zen: delete this;

          D Offline
          D Offline
          digwizfox
          wrote on last edited by
          #4

          Thanks, it seems like I have successfully done this and can now build and compile. However, the project that use to be the winhelp project, the .chm file is not being built. I thought I had changed all of the differences over and added all of the help directories and files to the project. I've got the .hhc, .hhk, and .hhp along with the .htm directories. The project settings look exactly the same. But when I build, I can't seem to understand why my .chm file doesn't get built. What triggers this process? I just need a hint so that I can figure this out. Perhaps there is a bad path or something in a resource or .htm file I need to change. Any hints would be appreciated and thanks again for your time. Regards, Shawn

          D 1 Reply Last reply
          0
          • D digwizfox

            Thanks, it seems like I have successfully done this and can now build and compile. However, the project that use to be the winhelp project, the .chm file is not being built. I thought I had changed all of the differences over and added all of the help directories and files to the project. I've got the .hhc, .hhk, and .hhp along with the .htm directories. The project settings look exactly the same. But when I build, I can't seem to understand why my .chm file doesn't get built. What triggers this process? I just need a hint so that I can figure this out. Perhaps there is a bad path or something in a resource or .htm file I need to change. Any hints would be appreciated and thanks again for your time. Regards, Shawn

            D Offline
            D Offline
            digwizfox
            wrote on last edited by
            #5

            I just wanted to close out this thread. I figured it out. The actual project file itself is built by the application wizard with some directives for compiling the appropriate help file(.chm for HTML help). So you definitely have to use the app wizard to create a new project file. You can continue to use the already developed files such as mainframe.[cpp and h]. But you have to copy in paste in a new project file and recreate the solution as well. Also, the output directory (debug/release) need to be completely cleaned in order to eliminate all previous winhelp files that were compiler generated. Other than that, the process is straightforward. Since I hadn't already implemented a lot of the help associated with winhelp there was not much code to change. Just add a call to EnableHtmlHelp() in your application object constructor. I also had to copy all of files from the app wizard generated hlp directory from the new temp project into the old one so that I had all of the default .htm and .hh* files in the directory for working with the HTML files. Shawn

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups