Click here to Skip to main content
15,912,072 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralNetWork Pin
gamitech5-Dec-04 6:51
gamitech5-Dec-04 6:51 
GeneralRe: NetWork Pin
Graham Bradshaw5-Dec-04 9:35
Graham Bradshaw5-Dec-04 9:35 
GeneralRe: NetWork Pin
gamitech6-Dec-04 2:22
gamitech6-Dec-04 2:22 
Generalrichedit classes and pressing keys Pin
Anonymous5-Dec-04 6:23
Anonymous5-Dec-04 6:23 
GeneralRe: richedit classes and pressing keys Pin
Vancouver5-Dec-04 13:03
Vancouver5-Dec-04 13:03 
GeneralEthernet Adapter Parmas Pin
skringel5-Dec-04 1:17
skringel5-Dec-04 1:17 
GeneralHtml help files Pin
includeh104-Dec-04 18:48
includeh104-Dec-04 18:48 
GeneralRe: Html help files Pin
digwizfox5-Dec-04 7:56
digwizfox5-Dec-04 7:56 
Check out this website.

http://www.mvps.org/htmlhelpcenter/

I found the sample projects to be useful even though the tutorials are not that great. I was looking at htmlhelp recently and did not get much help from the newsgroups nor could I find much on the web. But the C++ example here was quite useful, so you can download it, compile it, and use the debugger to figure out what is going on.

When you use the htmlhelp api to to tell your program to display a particular help file, within the htmlhelp window, it will expand the table of contents for you. I don't do anything specific to make it happen; it just does it. I implemented context help to allow me to press the '?' button on the upper right of my window and then when you select a dialogue item, it will call the html api function like so...

That is one example; you might have switch statements or some pattern for interpreting the ID of the resource and then calling the appropriate version of ::HtmlHelp. Notice the '::'. I am using the global api function. There is an HtmlHelp function built into the mfc classes as well and I do not use those. I use the global function. Why? Cause it just works for me, I guess.

Here is some example code. You see I am responding to the OnHelpInfo method in my dialog class. I setup the help path to my .htm file and then when I call ::HtmlHelp at the bottom, it will open the main html help window with the table of contents displayed and it will expand them to the file I am telling it to display specifically.

Hope that gets your started. That's all I know; and the htmlhelp documentation, that I have found, really stinks. So I learned how to do things using the example code on the aforementioned website. I still have no idea how it really works.

BOOL CDataReductionDlg::OnHelpInfo(HELPINFO* pHelpInfo)
{
CWinApp* theApp = AfxGetApp();
//Get the help file name
CString sHelpFilePath = theApp->m_pszHelpFilePath;
//sHelpFilePath += _T("::/hid_sc_size.htm");
switch(pHelpInfo->iCtrlId)
{
case IDC_START_DAY:
case IDC_SPIN_START_DAY :
case IDC_START_HOUR:
case IDC_SPIN_START_HOUR:
case IDC_START_MINUTE:
case IDC_SPIN_START_MINUTE:
case IDC_START_SECOND:
case IDC_SPIN_START_SECOND:
case IDC_START_MILLISEC:
case IDC_SPIN_START_MILLISEC:
case IDC_END_DAY:
case IDC_SPIN_END_DAY:
case IDC_END_HOUR:
case IDC_SPIN_END_HOUR:
case IDC_END_MINUTE:
case IDC_SPIN_END_MINUTE:
case IDC_END_SECOND:
case IDC_SPIN_END_SECOND:
case IDC_END_MILLISEC:
case IDC_SPIN_END_MILLISEC:
case IDC_STATIC_FILESTART:
case IDC_STATIC_FILESTOP:
sHelpFilePath += _T("::/task_ex_time_segments.htm");
break;

case IDC_BROWSE_INPUT:
case IDC_FILENAME_OUTPUT:
case IDC_BROWSE_OUTPUT:
case IDC_FILENAME_INPUT:
sHelpFilePath += _T("::/task_ex_file_selection.htm");
break;
case IDC_JMSG_FILTER :
case IDC_GWMSG_FILTER:
sHelpFilePath += _T("::/task_ex_using_filters.htm");
break;

case IDC_CANCEL_BUTTON:
case IDC_START:
sHelpFilePath += _T("::/task_ex_output_desc.htm");
break;

default:
break;
}
//If no additional topic was appended to the help path, then the default
//topic will be displayed.
::HtmlHelp(m_hWnd,
sHelpFilePath,
HH_DISPLAY_TOPIC,
NULL);

return TRUE;
}


GeneralRe: Html help files Pin
includeh106-Dec-04 10:07
includeh106-Dec-04 10:07 
GeneralSelecting Region of Interest(ROI) in images Pin
ashsri4-Dec-04 16:06
ashsri4-Dec-04 16:06 
GeneralRe: Selecting Region of Interest(ROI) in images [modified] Pin
qilujo20-Jul-09 2:13
qilujo20-Jul-09 2:13 
Generalvc60.pdb Pin
Andy H4-Dec-04 11:14
Andy H4-Dec-04 11:14 
GeneralRe: vc60.pdb Pin
ashsri4-Dec-04 15:57
ashsri4-Dec-04 15:57 
GeneralRe: vc60.pdb Pin
Andy H4-Dec-04 22:17
Andy H4-Dec-04 22:17 
GeneralRe: vc60.pdb Pin
Gary R. Wheeler5-Dec-04 10:06
Gary R. Wheeler5-Dec-04 10:06 
Generalinterchanging between two dialog boxes Pin
haseeb_saeed4-Dec-04 10:34
haseeb_saeed4-Dec-04 10:34 
GeneralRe: interchanging between two dialog boxes Pin
John R. Shaw4-Dec-04 11:35
John R. Shaw4-Dec-04 11:35 
Questionhow to control program execution speed Pin
Mohammad A Gdeisat4-Dec-04 9:16
Mohammad A Gdeisat4-Dec-04 9:16 
AnswerRe: how to control program execution speed Pin
Stanciu Vlad4-Dec-04 9:37
Stanciu Vlad4-Dec-04 9:37 
AnswerRe: how to control program execution speed Pin
John R. Shaw4-Dec-04 10:34
John R. Shaw4-Dec-04 10:34 
GeneralRe: how to control program execution speed Pin
Mohammad A Gdeisat5-Dec-04 5:43
Mohammad A Gdeisat5-Dec-04 5:43 
GeneralRe: how to control program execution speed Pin
David Crow6-Dec-04 3:08
David Crow6-Dec-04 3:08 
GeneralRe: how to control program execution speed Pin
Mohammad A Gdeisat6-Dec-04 9:31
Mohammad A Gdeisat6-Dec-04 9:31 
GeneralRe: how to control program execution speed Pin
David Crow6-Dec-04 9:39
David Crow6-Dec-04 9:39 
GeneralRegistering file type and icon Pin
SloanCode4-Dec-04 7:40
SloanCode4-Dec-04 7:40 

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.