Overriding OnHelp() in property pages
Ram Kishore -- Ram_Kishore.IDEA@idea.com
Wednesday, September 25, 1996
Environment: MSVC 4.2 WinNT 4.0
Hi All,
I have a property sheet having many property pages
Could somebody tell me how we can write Help messages for property pages
Thanks in advance
Ram.
Gonzalo Isaza -- gonzaloi@microsoft.com
Friday, September 27, 1996
[Mini-digest: 3 responses]
For every property page you want help on, do the following
pmypage->m_psp.dwFlags |= PSP_HASHELP;
Then include the ID of the property page dialog (IDD_PAGE1 or whatever
the name) in rtf file, like any other help topic, and MFC will do the
rest of the magic for you.
Gonzalo
This words are my own. I don't speak for Microsoft.
>----------
>From: Ram Kishore[SMTP:Ram_Kishore.IDEA@idea.com]
>Sent: Wednesday, September 25, 1996 4:18 PM
>To: mfc-l
>Subject: Overriding OnHelp() in property pages
>
>Environment: MSVC 4.2 WinNT 4.0
>Hi All,
> I have a property sheet having many property pages
>Could somebody tell me how we can write Help messages for property pages
>Thanks in advance
>Ram.
>
>
-----From: Valery Barer
You can do it in your CYourPropertySheet relying upon the page names,
like this:
BEGIN_MESSAGE_MAP(CYourPropertySheet, CPropertySheet)
...
ON_COMMAND(ID_HELP, OnHelp)
...
END_MESSAGE_MAP()
void CYourPropertySheet::OnHelp()
{
CString sPage;
GetActivePage()->GetWindowText(sPage);
MessageBox("This is the " + sPage + " help.");
}
Valery Barer
-----From: "Ferguson, Jeff"
> Hi All,
Well, my name's Jeff, not All, but I forgive you. Your question please?
> I have a property sheet having many property pages
> Could somebody tell me how we can write Help messages for property
pages
It's not clear whether you're asking to have one help topic for the
entire sheet or if you need a separate help topic for each property page.
For all I know, you may be asking for information about those wacky
"What's This?" cursors. I can't tell. I'll answer by assuming that you're
asking for information on making the right topic come up when the user
presses the "Help" button on the bottom of the property sheet.
If you need a separate help topic for every property page, then MFC has
done most of the work for you. Assuming that you have a sheet with three
pages, having dialog IDs of IDD_PAGE_ONE, IDD_PAGE_TWO and
IDD_PAGE_THREE, respectively, then you need to write three corresponding
help topics, with IDs of HIDD_PAGE_ONE, HIDD_PAGE_TWO and IDD_PAGE_THREE.
When the user presses the "Help" button, MFC will invoke WinHelp and will
request that the topic corresponding to the currently active page will be
displayed. You're done; the end (or "Los Endos", as us Genesis fans like
to say).
If you need a single help topic for the entire sheet, then write it and
give it a unique topic ID (let's call it HIDD_SHEET_TOPIC for argument's
sake). Then list maps from the property page help topic IDs to the single
sheet topic ID in the [ALIAS] section of your help project file, as in
[ALIAS]
HIDD_PAGE_ONE = HIDD_SHEET_TOPIC ; sorry, I have forgotten the exact
syntax
HIDD_PAGE_TWO = HIDD_SHEET_TOPIC ; sorry, I have forgotten the exact
syntax
HIDD_PAGE_THREE = HIDD_SHEET_TOPIC ; sorry, I have forgotten the exact
syntax
In either case, your work is done in the help file and will not require
you to override any of MFC's WinHelp() member functions.
All of this assumes that you enabled the Context-Sensitive Help option in
an App-Wizard generated application. If you didn't, or even if you did,
see Knowledgebase article Q132715 in Books Online or on Microsoft's Web
site. In researching an answer to this question, I did a Books Online
search of ""property sheet" "help button'" and got 17 hits. You might
want to look at all of those articles.
> Thanks in advance
Please get me a guest shot on MYSTERY SCIENCE THEATER 3000. Thanks in
advance.
[Moderator's note: We have you booked for November 7. The movie is
"Attack of the 50-foot Chicken Wing". You'll be playing the part
of a coke spilled on the floor of the 3rd row. Your motivation is
"sticky". Be in makeup at 2:00PM...]
| Вернуться в корень Архива
|