Click here to Skip to main content
15,928,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralChange width of treelistctrl header Pin
SnapRick28-May-02 7:45
SnapRick28-May-02 7:45 
GeneralCannot create my MDI document Pin
spoulson28-May-02 6:44
spoulson28-May-02 6:44 
GeneralDebug info missing Pin
Jason Hihn28-May-02 5:37
Jason Hihn28-May-02 5:37 
GeneralRe: Debug info missing Pin
_Magnus_28-May-02 5:47
_Magnus_28-May-02 5:47 
Generala question about HtmlHelp Pin
lucy28-May-02 5:21
lucy28-May-02 5:21 
GeneralRe: a question about HtmlHelp Pin
Tim Smith28-May-02 6:05
Tim Smith28-May-02 6:05 
GeneralRe: a question about HtmlHelp Pin
lucy28-May-02 6:07
lucy28-May-02 6:07 
GeneralRe: a question about HtmlHelp Pin
Tomasz Sowinski28-May-02 8:07
Tomasz Sowinski28-May-02 8:07 
You don't have to switch to vc7 - just override WinHelp method in your mainframe class. Here's the piece from old program (written using vc6) using HtmlHelp:
void CMainFrame::WinHelp(DWORD dwData, UINT nCmd) 
{
	// original MFC implementation
	
	CWinApp* pApp = AfxGetApp();
	ASSERT_VALID(pApp);
	ASSERT(pApp->m_pszHelpFilePath != NULL);

	CWaitCursor wait;
	if (IsFrameWnd())
	{
		// CFrameWnd windows should be allowed to exit help mode first
		CFrameWnd* pFrameWnd = (CFrameWnd*)this;
		pFrameWnd->ExitHelpMode();
	}

	// cancel any tracking modes
	SendMessage(WM_CANCELMODE);
	SendMessageToDescendants(WM_CANCELMODE, 0, 0, TRUE, TRUE);

	// need to use top level parent (for the case where m_hWnd is in DLL)
	CWnd* pWnd = GetTopLevelParent();
	pWnd->SendMessage(WM_CANCELMODE);
	pWnd->SendMessageToDescendants(WM_CANCELMODE, 0, 0, TRUE, TRUE);

	// attempt to cancel capture
	HWND hWndCapture = ::GetCapture();
	if (hWndCapture != NULL)
		::SendMessage(hWndCapture, WM_CANCELMODE, 0, 0);

	//TRACE3("WinHelp: pszHelpFile = '%s', dwData: $%lx, fuCommand: %d.\n",
	//	pApp->m_pszHelpFilePath, dwData, nCmd);

	// finally, run the Windows Help engine
	//if (!::WinHelp(pWnd->m_hWnd, pApp->m_pszHelpFilePath, nCmd, dwData))
	//	AfxMessageBox(AFX_IDP_FAILED_TO_LAUNCH_HELP);

	TRACE0("*** HtmlHelp(");
	DWORD dwHtmlData = 0;
	UINT nHtmlCmd;
	switch (nCmd)
	{
	case HELP_CONTEXT:
		TRACE0("Context");
		nHtmlCmd = HH_HELP_CONTEXT;
		dwHtmlData = dwData;
		break;
	case HELP_CONTENTS:
		TRACE0("TOC");
		nHtmlCmd = HH_DISPLAY_TOC;
		break;
	default:
		TRACE0("other");
		nHtmlCmd = HH_DISPLAY_TOC;
	}

    // get the html help filename here
    CString strHelpFile = ...;

	TRACE("): %s %x %d (wh:%d)\n", strHelpFile, dwHtmlData, nHtmlCmd, nCmd);
	if (NULL == ::HtmlHelp(m_hWnd, strHelpFile, nHtmlCmd, dwHtmlData))
	{
		AfxMessageBox(AFX_IDP_FAILED_TO_LAUNCH_HELP);
	}
}



Tomasz Sowinski -- http://www.shooltz.com

- It's for protection
- Protection from what? Zee Germans?

GeneralRe: a question about HtmlHelp Pin
lucy28-May-02 8:23
lucy28-May-02 8:23 
GeneralRe: a question about HtmlHelp Pin
Tomasz Sowinski28-May-02 8:21
Tomasz Sowinski28-May-02 8:21 
GeneralRe: a question about HtmlHelp Pin
lucy28-May-02 9:53
lucy28-May-02 9:53 
GeneralRe: a question about HtmlHelp Pin
Tim Smith28-May-02 10:17
Tim Smith28-May-02 10:17 
GeneralRe: a question about HtmlHelp Pin
Tomasz Sowinski28-May-02 11:05
Tomasz Sowinski28-May-02 11:05 
GeneralRe: a question about HtmlHelp Pin
lucy28-May-02 12:02
lucy28-May-02 12:02 
GeneralWOW I never thought... Pin
Abin28-May-02 20:38
Abin28-May-02 20:38 
GeneralRe: WOW I never thought... Pin
lucy29-May-02 3:01
lucy29-May-02 3:01 
Generaldialog window doesn't show contents Pin
28-May-02 5:13
suss28-May-02 5:13 
GeneralRe: dialog window doesn't show contents Pin
Ed Gadziemski30-May-02 12:41
professionalEd Gadziemski30-May-02 12:41 
GeneralDebug Symbols Pin
28-May-02 5:06
suss28-May-02 5:06 
QuestionHow do i round a number to the nearest integer? Pin
redeemer28-May-02 4:39
redeemer28-May-02 4:39 
AnswerRe: How do i round a number to the nearest integer? Pin
_Magnus_28-May-02 4:56
_Magnus_28-May-02 4:56 
AnswerRe: How do i round a number to the nearest integer? Pin
Prem Kumar28-May-02 4:57
Prem Kumar28-May-02 4:57 
AnswerRe: How do i round a number to the nearest integer? Pin
Rick York28-May-02 8:32
mveRick York28-May-02 8:32 
QuestionHow to get context Cmenu AND mouse move info? Pin
Pierre Couderc28-May-02 4:30
Pierre Couderc28-May-02 4:30 
GeneralGetCommMask failure. Pin
dejan.n28-May-02 4:10
dejan.n28-May-02 4:10 

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.