Click here to Skip to main content
15,919,245 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDrive letter? Pin
Bob Stanneveld21-Jul-03 11:17
Bob Stanneveld21-Jul-03 11:17 
AnswerRe: Drive letter? Pin
J. Dunlap21-Jul-03 11:39
J. Dunlap21-Jul-03 11:39 
GeneralRe: Drive letter? Pin
Bob Stanneveld21-Jul-03 12:05
Bob Stanneveld21-Jul-03 12:05 
QuestionFast read in data? Pin
Kevein21-Jul-03 11:15
Kevein21-Jul-03 11:15 
AnswerRe: Fast read in data? Pin
Neville Franks21-Jul-03 12:02
Neville Franks21-Jul-03 12:02 
AnswerRe: Fast read in data? Pin
Bob Stanneveld21-Jul-03 12:02
Bob Stanneveld21-Jul-03 12:02 
GeneralEnabling a project for context sensitive help Pin
haritadala21-Jul-03 10:19
haritadala21-Jul-03 10:19 
GeneralRe: Enabling a project for context sensitive help Pin
Toni7821-Jul-03 13:47
Toni7821-Jul-03 13:47 
I have this Help tutorial that explains how to solve your problem. I am just going to paste it here. I have never used these concepts because I never forgot to check "Context Sensitive help".
Manually Add the Context Hooks
If you already have a program and need to add help, you can manually edit the files to create the necessary
hooks.
To add context sensitive help manually:
1. Add the necessary message map entries in the message map of the Main Frame class. If you created the
program with the MFC App Wizard and specified that you wanted context help, these items should already
be in the file.
ON_COMMAND(ID_HELP_FINDER, CMDIFrameWnd::OnHelpFinder)
ON_COMMAND(ID_HELP, CMDIFrameWnd::OnHelp)
ON_COMMAND(ID_CONTEXT_HELP, CMDIFrameWnd::OnContextHelp)
ON_COMMAND(ID_DEFAULT_HELP, CMDIFrameWnd::OnHelpFinder)
2. Copy the What's This? Help icon into a button on your toolbar. This icon is available as a bitmap in
C:\Program Files\Microsoft Visual Studio\Common\Graphics\Bitmaps\OffCtlBr\Small\Color\help.bmp.
3. Assign ID_CONTEXT_HELP to the What's This? Help button.
Note:
• This creates the same basic hooks in the program as the App Wizard, but does not generate a framework
help file or the .hm file with the topic ID mapping. You will need to create a list of IDs for the help author
to use.
Override the Default Context Help Behavior
The default WinHelp call made from the hooks automatically created by the App Wizard opens each help topic
in the main WinHelp window. Unfortunately the current recommended behavior is:
• Control level help is opened in a popup.
• Window level help is opened in a secondary window.
To create these conditions, you must override the default functions.
To create currently recommended behavior:
1. In the Main Frame class, create an OnHelpInfo function using the Class Wizard:
BOOL CMainFrame::OnHelpInfo(HELPINFO* pHelpInfo)
{
return TRUE;
}
This effectively disables the function, and is necessary because, in combination with the next override, all
topics accessed through the F1 key will be called twice. Unfortunately you cannot use the OnHelpInfo
function in the Main Frame since (unlike in dialog boxes) it is triggered only by the F1 key and not by Shift-
F1 or the key.
2. In the Main Frame class, create a WinHelp function using the Class Wizard:
void CMainFrame::WinHelp(DWORD dwData, UINT nCmd)
{
CWinApp* theApp = AfxGetApp();
CString helpFilePath = theApp->m_pszHelpFilePath;
switch ( dwData ) {
case HIDR_MAINFRAME:
case HIDR_MFCWIZTYPE:
case HIDD_ABOUTBOX:
case HIDD_TESTDLG:
//Topics that need to go into a secondary window.
helpFilePath = helpFilePath + ">second";
::WinHelp(m_hWnd, helpFilePath, HELP_CONTEXT, dwData);
break;
case WHATEVER
//Topics that need to go into a different secondary window
...
break;
default:
//All the rest are popups
::WinHelp(m_hWnd, helpFilePath, HELP_CONTEXTPOPUP, dwData);
break; }
}
Tips:
• It is often easier to create a separate function or class to process the help calls and open topics in the
correct window. This can be part of the main program or can be created as a separate DLL. The main
advantage of a DLL is that it can be called from other programs if necessary.
• If you want the help author to be able to control the help file and window called by this function, class, or
DLL, put the help file and window definitions in an INI file (you can use the topic number as the key) and
look them up before calling Help. If you include the help type as an INI file entry you can easily call
multiple types of user assistance from the same program.


// Afterall, I realized that even my comment lines have bugs

When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
GeneralIDE Dialog Problem Pin
Grahamfff21-Jul-03 10:08
Grahamfff21-Jul-03 10:08 
Generalpath to exe file Pin
martin_j21-Jul-03 8:11
martin_j21-Jul-03 8:11 
GeneralRe: path to exe file Pin
Larry Antram21-Jul-03 8:33
Larry Antram21-Jul-03 8:33 
GeneralRe: path to exe file Pin
Toni7821-Jul-03 9:24
Toni7821-Jul-03 9:24 
GeneralRe: path to exe file Pin
martin_j21-Jul-03 20:03
martin_j21-Jul-03 20:03 
GeneralRe: path to exe file Pin
Jens Doose21-Jul-03 22:20
Jens Doose21-Jul-03 22:20 
GeneralEmbedded HTML pages + images Pin
Tommy2k21-Jul-03 7:53
Tommy2k21-Jul-03 7:53 
GeneralRe: Embedded HTML pages + images Pin
Michael Dunn21-Jul-03 14:07
sitebuilderMichael Dunn21-Jul-03 14:07 
GeneralRe: Embedded HTML pages + images Pin
Tommy2k24-Jul-03 12:21
Tommy2k24-Jul-03 12:21 
GeneralRe: Embedded HTML pages + images Pin
Michael Dunn24-Jul-03 12:33
sitebuilderMichael Dunn24-Jul-03 12:33 
GeneralRe: Embedded HTML pages + images Pin
Tommy2k24-Jul-03 22:58
Tommy2k24-Jul-03 22:58 
QuestionResizing image right bottom? Pin
Dominik Reichl21-Jul-03 7:26
Dominik Reichl21-Jul-03 7:26 
AnswerRe: Resizing image right bottom? Pin
J. Dunlap21-Jul-03 8:17
J. Dunlap21-Jul-03 8:17 
GeneralRe: Resizing image right bottom? Pin
Dominik Reichl21-Jul-03 9:12
Dominik Reichl21-Jul-03 9:12 
GeneralRe: Resizing image right bottom? Pin
Dominik Reichl21-Jul-03 9:28
Dominik Reichl21-Jul-03 9:28 
GeneralRe: Resizing image right bottom? Pin
J. Dunlap21-Jul-03 9:47
J. Dunlap21-Jul-03 9:47 
GeneralRe: Resizing image right bottom? Pin
Dominik Reichl21-Jul-03 23:45
Dominik Reichl21-Jul-03 23:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.