Winhelp vs. HTML help context
-
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.
-
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.
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;
-
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.
I still use VS 6.0, but I guess my considerations could help. All you need is to redefine the
CWinApp
virtual functionWinHelp
. Then, define aCString
memberm_strHelpFilePath
and put a full path to your .chm in it inCApp::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 ofhwndDesktop
. Hope this helps. -
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;
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
-
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
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