A
Ahmad Jalil Qarshi
hi!
I have an ActiveX control for Word written in VC++7.1 using ATL. now when i
insert my control into Word document and print it. It just displays image
rendered on it but doesn't diplay the text displayed on the control. my
OnDraw function looks like that.
HRESULT CMyObj::OnDraw(ATL_DRAWINFO & di)
{
RECT& rc = *(RECT*)di.prcBounds;
RECT TextRect = {0,35,rc.right,rc.bottom/2};
m_CompLogoImg->get_Width(&lImgWidth);
m_CompLogoImg->get_Height(&lImgHeight);
HRESULT hres = m_CompLogoImg->Render(di.hdcDraw,rc.right*3/4,
rc.bottom/2, rc.right*1/4, rc.bottom/2, 0, lImgHeight,
lImgWidth, -(lImgHeight), &r);
CComBSTR bstrText = _T("Location");
ExtTextOut(di.hdcDraw,TextRect.left +2 , TextRect.top,ETO_CLIPPED,
&TextRect, OLE2T(bstrText.m_str), bstrText.Length(), NULL); return S_OK;
}
i found an article
http://www.codeguru.com/Cpp/COM-Tech/atl/printing/article.php/c3559/ but
couldn't understand it well. any body there to solve this problem
Thanks in advance.
Ahmad Jalil Qarshi
I have an ActiveX control for Word written in VC++7.1 using ATL. now when i
insert my control into Word document and print it. It just displays image
rendered on it but doesn't diplay the text displayed on the control. my
OnDraw function looks like that.
HRESULT CMyObj::OnDraw(ATL_DRAWINFO & di)
{
RECT& rc = *(RECT*)di.prcBounds;
RECT TextRect = {0,35,rc.right,rc.bottom/2};
m_CompLogoImg->get_Width(&lImgWidth);
m_CompLogoImg->get_Height(&lImgHeight);
HRESULT hres = m_CompLogoImg->Render(di.hdcDraw,rc.right*3/4,
rc.bottom/2, rc.right*1/4, rc.bottom/2, 0, lImgHeight,
lImgWidth, -(lImgHeight), &r);
CComBSTR bstrText = _T("Location");
ExtTextOut(di.hdcDraw,TextRect.left +2 , TextRect.top,ETO_CLIPPED,
&TextRect, OLE2T(bstrText.m_str), bstrText.Length(), NULL); return S_OK;
}
i found an article
http://www.codeguru.com/Cpp/COM-Tech/atl/printing/article.php/c3559/ but
couldn't understand it well. any body there to solve this problem
Thanks in advance.
Ahmad Jalil Qarshi