Community
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Carlos Kruger" <
href="mailto:carloskruger@speedy.com.ar">carloskruger@speedy.com.ar>
wrote in message
href="news:0615712EE93D2CE60D3B4F7DBCAA851E@in.WebX.maYIadrTaRb">news:0615712EE93D2CE60D3B4F7DBCA......
Hi Ben
> getPageViewer : undeclared
identifier
> Call GetViewer on your m_ev instance
I DID THIS:
face=Arial>
CComPtr<IDispatch>
pIDispPageViewer;
pIDispPageViewer =
m_pAdViewerWin.GetViewer();
CComQIPtr<AdPageView::IAdPageViewer>
pPageViewer = pIDispPageViewer;
if ( !pPageViewer
) return E_FAIL;
> In regards to the PrintEx error,
without seeing your code I am not exactly
> sure what the problem is,
but based on the error I think you have something
> like
>
> pAdPageViewer.PrintEx ( .........
> when you
should have
> pAdPageViewer->PrintEx (
...........
Here is my code (with corrections), sameWhen I type pPageViewer-> , I get all the
as yours, except I've got pPageViewer in replace of
pAdPageViewer
methods but there is no PrintEx in the list
I DID THIS:
if ( FAILED (hr =
pPageViewer->WaitForPageLoaded ())
) return
hr;
CComQIPtr<AdPageView::IAdCollection>
pPageCollection;
pPageCollection = pPageViewer->GetPages ();
if (
!pPageCollection ) return
E_FAIL;
CString buff (sourcePath);
DOCINFO
docI;
memset( &docI, 0, sizeof(DOCINFO) );
docI.cbSize = sizeof
(DOCINFO);
docI.lpszDocName = buff;
int nError =
StartDoc(m_hDC, &docI);
if ( nError <= 0
) return E_FAIL;
long pageCount =
pPageCollection->GetCount();
for ( int pNum = 1; pNum <= pageCount
&& SUCCEEDED (hr) ; pNum++
)
{
CComVariant vPageIndex,
vPage;
vPageIndex.vt =
VT_I4;
vPageIndex.lVal =
pNum;
vPage =
pPageCollection->GetItem
(vPageIndex);
pPageViewer->PutPage
(vPage);
if (FAILED (hr =
pPageViewer->WaitForPageLoaded () )) break;
size=2>
CComQIPtr<AdPageView::IAdPage> pPage =
vPage.pdispVal;
CComQIPtr<AdPageView::IAdPagePaper> pPaper = pPage->GetPaper
();
double paperWidth =
pPaper->GetWidth();
double
paperHeight = pPaper->GetHeight();
hr = pPageViewer->PrintEx ( (wireHDC)m_hDC, 0.0,0.0,
paperWidth,paperHeight, VARIANT_TRUE );
}
Thanks you for your help
Carlos
size=2>