Solved

Help button cant work

Posted on 2001-06-07
3
224 Views
Last Modified: 2013-11-20
I have made a PropertySheet, and enabled, the Help button.. I want to call WinHelp when the button is pressed, How is that done ?

Please give me some code
0
Comment
Question by:win32
3 Comments
 
LVL 3

Expert Comment

by:_mb_
ID: 6163530
You must create your mfc project with Windows help support (within step 4 of the application wizard)? That's all you have to do. The CPropertySheet's help buttons already contains functionality to call the help.
0
 

Author Comment

by:win32
ID: 6163589
0
 
LVL 2

Accepted Solution

by:
GloriousRain earned 50 total points
ID: 6166298
using
AfxGetApp()->WinHelp(0x10000 + ID_MYCOMMAND);
<MSDN>
CWinApp::WinHelp
virtual void WinHelp( DWORD dwData, UINT nCmd = HELP_CONTEXT );

Parameters

dwData

Specifies additional data. The value used depends on the value of the nCmd parameter.

nCmd

Specifies the type of help requested. For a list of possible values and how they affect the dwData parameter, see theWinHelp Windows function.

Remarks

Call this member function to invoke the WinHelp application. The framework also calls this function to invoke the WinHelp application.

The framework will automatically close the WinHelp application when your application terminates.

Example

// Header File: HELPIDS.H
//
// This example header file is #include'd twice:
// (1) It is #include'd by the .CPP file that passes the DWORD
//     context i.d. to CWinApp::WinHelp.
// (2) It is #include'd in the [MAP] section of the .HPJ file,
//     to associate the help context string "HID_MYTOPIC" with
//     the help context numeric i.d., 101.
// The help context string "HID_MYTOPIC" is what identifies the
// help topic in the help .RTF source file, in the "#" footnote:
//     # HID_MYTOPIC
//
// Note, it is not necessary to manage help context id's this way
// for help topics associated with command id's and user interface
// id's defined in your RESOURCE.H file; you should use the MAKEHM
// tool via the custom build rule on your resource.h file to produce
// a help map (.HM) file for these id's.  It is necessary to manage
// help context id's as illustrated here only for help topics not
// associated with command id's or user interface id's.

#define HID_MYTOPIC 101
 

   // Show the custom help topic that has the context string
   // "HID_MYTOPIC" in the help .RTF file, and which is mapped
   // to the DWORD i.d. HID_MYTOPIC in the above HELPIDS.H file.
   AfxGetApp()->WinHelp(HID_MYTOPIC);
 

// The following is one line of code in the help map (.HM)
// file produced by the MAKEHM tool, which is called by the custom
// build rule on the resource.h file.  The MAKEHM tool reads the
// following #define in the application's RESOURCE.H file:
//    #define ID_MYCOMMAND 0x08004
// and adds a help id offset value of 0x10000 to create the
// help context DWORD value 0x18004.  See MFC Tech Note 28
// for more information on help id offset values.
 
HID_MYCOMMAND                           0x18004
 

   // Rarely will you need to directly call WinHelp yourself
   // with the help context i.d. for a command or user interface
   // object. The framework will call WinHelp automatically when
   // the user, for example, hits F1 when the focus is on a
   // My Command menu item. However, if you do want to directly
   // call WinHelp for the help topic associated with the command,
   // here is how you would do it:

   AfxGetApp()->WinHelp(0x10000 + ID_MYCOMMAND);

CWinApp Overview |  Class Members |  Hierarchy Chart

See Also   CWinApp::OnContextHelp, CWinApp::OnHelpUsing, CWinApp::OnHelp, CWinApp::OnHelpIndex,::WinHelp


--------------------------------------------------------------------------------
Send feedback to MSDN.Look here for MSDN Online resources.
<MSDN>
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Strange date stored 22 124
Generic progress indicator 6 117
Use of condition with 'serial' in ansible 2 62
wordcount challenge 11 123
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question