Can I display HTML help within CAxWindow 
Author Message
 Can I display HTML help within CAxWindow

I have an application which has a CAxWindow in a splitter window. I would
like to display help pages this window (if possible) so that when the user
selects a window, the help page for that window is (or can be) automatically
be displayed within this CAxWindow. Or is there a way to display a specifc
help page via a URL (i.e. using a web browser's navigate method) ?

Many thanks
Mark



Wed, 18 Feb 2004 23:58:36 GMT  
 Can I display HTML help within CAxWindow
Here is some code(I have used WTL classes for CRect and CString):
// CAxWindow here is created dynamically. WM_CREATE is good place for this
or WM_INITDIALOG for dialog box.
 HWND hwnd = GetDlgItem(IDC_HTML); // IDC_HTML is place for your CAxWindow.
One of your windows in splitter.
  CRect rc;
  ::GetClientRect(hwnd,&rc);
  CString strhtml("res://");
  char szModule[_MAX_PATH];
  char szResID[256];
  // Make resource string
  GetModuleFileName(_Module.GetModuleInstance(), szModule, _MAX_PATH);
  strhtml +=(szModule);
  strhtml +='/';
  sprintf(szResID, _T("%0d"), IDR_HTMLABOUT); // this is resource for html
  strhtml +=szResID;
  // Ok. String is ready let's make window
HWND htmlwnd = ::CreateWindowEx(NULL,"AtlAxWin",strhtml ,
         WS_CHILD|WS_VISIBLE|WS_VSCROLL| WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
rc.left , rc.top , rc.Width (), rc.Height  (), hwnd, NULL,
         ::GetModuleHandle(NULL), NULL);

You must be careful with CAxWindow because it makes memory leaks.
Mihail

Quote:
> I have an application which has a CAxWindow in a splitter window. I would
> like to display help pages this window (if possible) so that when the user
> selects a window, the help page for that window is (or can be)
automatically
> be displayed within this CAxWindow. Or is there a way to display a specifc
> help page via a URL (i.e. using a web browser's navigate method) ?

> Many thanks
> Mark



Fri, 20 Feb 2004 16:36:28 GMT  
 Can I display HTML help within CAxWindow
Michail

Thanks for the reply. I have actually got the CAxWindow and all that
(inclusive of memory leaks) sorted, the thing I wanted to do was to display
a page from a .chm file within the CAxWindow. I've since found how to do
this by using the ms-its protocol handler via a URL.

Mark


Quote:
> Here is some code(I have used WTL classes for CRect and CString):
> // CAxWindow here is created dynamically. WM_CREATE is good place for this
> or WM_INITDIALOG for dialog box.
>  HWND hwnd = GetDlgItem(IDC_HTML); // IDC_HTML is place for your
CAxWindow.
> One of your windows in splitter.
>   CRect rc;
>   ::GetClientRect(hwnd,&rc);
>   CString strhtml("res://");
>   char szModule[_MAX_PATH];
>   char szResID[256];
>   // Make resource string
>   GetModuleFileName(_Module.GetModuleInstance(), szModule, _MAX_PATH);
>   strhtml +=(szModule);
>   strhtml +='/';
>   sprintf(szResID, _T("%0d"), IDR_HTMLABOUT); // this is resource for html
>   strhtml +=szResID;
>   // Ok. String is ready let's make window
> HWND htmlwnd = ::CreateWindowEx(NULL,"AtlAxWin",strhtml ,
>          WS_CHILD|WS_VISIBLE|WS_VSCROLL| WS_CLIPSIBLINGS |
WS_CLIPCHILDREN,
> rc.left , rc.top , rc.Width (), rc.Height  (), hwnd, NULL,
>          ::GetModuleHandle(NULL), NULL);

> You must be careful with CAxWindow because it makes memory leaks.
> Mihail



Sat, 21 Feb 2004 01:55:23 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. seeking advice on displaying HTML within an app

2. CAxWindow::QueryHost and CAxWindow::QueryControl return E_FAIL

3. HTML Help Within IDE

4. Display BMP file as a panel in within a display window

5. Help with compiling a "canned" program

6. Need to be able to view and edit HTML from within a visual C# windows application

7. Call my Application within a html file???

8. How to create HTML Help Popup which contains real HTML text

9. Determining what canned preprocessor symbols are available

10. Beginner [Q] Using Canned File Open/Save dialog

11. Canned Dialogs

12. HTML display control

 

 
Powered by phpBB® Forum Software