The followings is part of my code.
.....
......
TCHAR content[]=TEXT("<html><head><title>hi</hi></head><body>good
day</body></html>");
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND htmlview;
g_hInstHTMLCtrl = LoadLibrary(TEXT("htmlview.dll"));
InitHTMLControl (hInstance);
htmlview = CreateWindow(DISPLAYCLASS, szTitle, dwStyle,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL,
hInstance, NULL);
SendMessage(htmlview,WM_SETTEXT,0,0);
SendMessage(htmlview,DTM_ADDTEXT,(WPARAM)(BOOL) false,(LPARAM)(LPSTR)
content);
SendMessage(htmlview,DTM_ENDOFSOURCE,0,0);
if (!htmlview)
return FALSE;
}
ShowWindow(htmlview, nCmdShow);
UpdateWindow(htmlview);
}
Just at a first read-through, you're using DTM_ADDTEXT, but you're passing a
Unicode string.
Try DTM_ADDTEXTW instead and let me know how it works?
HTH,
--
Terence "Dr. CE" Goggin
Information Appliance Assoc.
Windows CE Development and Consulting
terencegoggin AT hotmail DOT com
"roger" <ro...@neovue.com> wrote in message
news:#kWXR9T2AHA.2080@tkmsftngp02...
I am using MFC. All what I'm sending You is one function belowed:
int CHTMLCtrl::SetHTMLSource()
{
int iCurr = 0, iEndLine, iTemp, iLength = m_strSource.GetLength ();
char * pcLine;
m_wndHTML.SendMessage (WM_SETTEXT, 0, (LPARAM)(LPCTSTR) "");
while (iCurr < iLength)
{
if ((iEndLine = m_strSource.Find (13, iCurr)) != -1)
{
}
else
{
iEndLine = iLength;
}
pcLine = new char [iEndLine - iCurr + 1];
for (iTemp = 0; iTemp < iEndLine - iCurr; iTemp++)
{
*(pcLine + iTemp) = (char) m_strSource.GetAt(iCurr + iTemp);
}
*(pcLine + iTemp) = 0;
m_wndHTML.SendMessage (DTM_ADDTEXT, FALSE, (LPARAM)(LPSTR) pcLine);
delete [] pcLine;
iCurr = iEndLine + 2;
}
m_wndHTML.SendMessage (DTM_ENDOFSOURCE, 0, 0);
return 1;
}
as you see there is m_wndHTML varible. It's a member of CHTMLCtrl class,
whitch derived from CWnd. You can exchange all lines contained calling to
this member, with API's functions containde hWnd. Another member belongs to
CHTMLCtrl is m_strSource witch is CString. I place HTML Source here, before
call function.
If you had any problem (with my english more, I think), send my a line to
lszyd...@box43.pl.
Lukasz.
"roger" <ro...@neovue.com> wrote in message
news:#kWXR9T2AHA.2080@tkmsftngp02...
--
Terence "Dr. CE" Goggin
Information Appliance Assoc.
Windows CE Development and Consulting
terencegoggin AT hotmail DOT com
"roger" <ro...@neovue.com> wrote in message
news:uvIeZhb3AHA.2052@tkmsftngp03...