Solved

Help button cant work

Posted on 2001-06-07
3
242 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

737 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