QHTM Quick Start
We need to make some assumptions. We will assume that you are using C/C++ and that you are familiar with general Windows programming. I will also assume that you want to add QHTM to a dialog.
Adding a QHTM control to your projects requires several simple steps:
- Add the control to the dialog
Add a custom control to your dialog box, for the window class of the custom control you should use "QHTM_Window_Class_001". In MS Visual C++ you would do this by adding a custom control (the one with the head on it) and in the control properties you should change the edit field called "Class:" from a blank string to be "QHTM_Window_Class_001".
- Initialise the DLL
In the main file for your application you will need to call the QHTM initialisation function:
QHTM_Initialize( hInstance );
hInstance would be the instance of your program. For an MFC application this would look like:
VERIFY( QHTM_Initialize( AfxGetInstanceHandle() ) );
Don't forget to include the QHTM header file in any source files that use QHTM:
- Link to the LIB
You will need to link to the DLL. If you are using QHTMLight then you would link to QHTMLight.LIB
- Send QHTM some HTML
You can use the general SetWindowText (...) API to send some simple HTML to QHTM:
SetWindowText( GetDlgItem( IDC_HTML), "<b>Some bold text</b> <font color="red">And some red text</font>" );
For MFC programs you can make use of the control binding mechanism by adding a line in your
DoDataExchangefunction of your dialog:
DDX_Control( pDX, IDC_HTML, m_wndQHTM );
Where IDC_HTML is the ID of the control and m_wndQHTM is a CQHtmWnd declared in your dialog class.