Hi, I have created HTML View control. Now I'm trying to display images
(using CVOImage class) -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k/html/ppc_viewer.asp.
The problem is that image <img src="aaaa.bmp"> is displaying but
disappearing very quick - I have no idea, what is happening... Could someone
give me a solution? Maybe another way of declaring variables etc.?
Below is fragment of code for displaying images:
CVOImage img; // global
....
case WM_NOTIFY:
if(wParam==IDC_HTMLVIEW &&
((LPNMLISTVIEW)lParam)->hdr.code==NM_INLINE_IMAGE)
{
hDC = GetDC(hDlg);
if(img.Load(hDC,((NM_HTMLVIEW*)lParam)->szTarget))
{
INLINEIMAGEINFO imgInfo;
imgInfo.dwCookie = ((NM_HTMLVIEW*)lParam)->dwCookie;
imgInfo.iOrigHeight = img.GetHeight();
imgInfo.iOrigWidth = img.GetWidth();
imgInfo.hbm = img.Copy();
imgInfo.bOwnBitmap = FALSE;
SendMessage(((LPNMLISTVIEW)lParam)->hdr.hwndFrom,DTM_SETIMAGE,0,(LPARAM)&img
Info);
}
else
SendMessage(((LPNMLISTVIEW)lParam)->hdr.hwndFrom,DTM_IMAGEFAIL,0,((NM_HTMLVI
EW*)lParam)->dwCookie);
ReleaseDC(hDlg,hDC);
}
break;