Programming with Microsoft Visual C++.NET 6ed [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Programming with Microsoft Visual C++.NET 6ed [Electronic resources] - نسخه متنی

George Shepherd, David Kruglinski

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید








Example Ex19c: HTML Help


Ex19c is also based on example Ex18d. It is an MDI application that includes two views to a single document and uses HTML Help. The example was created using the MFC Application Wizard with HTML Help Format selected on the Advanced Features page.

If you look in the file

hid_window_newhexwindow , you'll see some updated help text reflecting the New String Window menu command. This is the text that appears whenever you select context-sensitive help for the New String Window command. Also notice a new file (one not generated by the MFC Application Wizard) named hid_window_newhex, which is the help text that appears for the New Hex Window command.

If you're feeling gutsy, you can modify the help files with Notepad. The file includes tags that are used by the HTML help system, so tread lightly. However, a better option is to open the .HTM file in Visual Studio .NET. Visual Studio .NET understands HTML files and lets you edit them easily.

You might wonder how to create new help topics in the first place? The easiest way to create a new help topic is to take an existing HTM file, rename it appropriately, and then add new content to the file. Then you associate the new HTM file with the command ID as described below.

Visual Studio .NET adds help context IDs when you add new menu commands to the program and recompile it. Near the top of the

HTMLDefines.h file, you'll see the following lines, which define help contexts for the New String Window menu command and the New Hex Window menu command:

#define HID_WINDOW_NEWSTRINGWINDOW                    0x10082
#define HID_WINDOW_NEWHEXWINDOW 0x10083

In addition to the standard menu command help created by the MFC Application Wizard, Ex19c has a new help topic for the New Hex Window command. The help context ID was generously included by Visual Studio .NET when the command was added. Now it needs to be tied to the

hid_window_newhexwindow file. A line in the

Ex19c.hhp file associates the help context ID with the help file:

hid_window_newhexwindow             = hid_window_newhexwindow

Finally, the

Ex19c.hhp file includes a reference to the new HTML file under the files tag:

[files]
afx_hidd_color
afx_hidd_fileopen
afx_hidd_filesave


hid_window_newstringwindow
hid_window_newhexwindow
hid_window_split



Once you relate the HTML files to the help command IDs, there's nothing else you need to do to get the help topics working. The rest of the built-in MFC help functionality will take care of the details for you. To see for yourself, run the Ex19c example, select various menu commands and push F1. You'll see the correct help screens appear after pressing F1.


/ 319