Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Activex printing from a webpage.

Status
Not open for further replies.

pkiran1975

Programmer
Oct 20, 2004
2
US
I have a custom activeX control that I embed in an IE web-page, I call a thirdparty software that draws some graphs given a HWND. I implemented OnDraw and able to display properly, but am unable to print the graphs drawn by the thirdparty software.

When I tried printing a ellipse drawn in the activex, it prints fine. But the graphs drawn using the third party software doesnt print.

I am very new to the MFC and also to the activeX. Any thoughts/help greatly appreciated.

Thanks,
Kiran.
 
More info on this see the code below, the third party function takes a HWND, I want to send it the window obtained from CDC*->GetWindow() (CDC* obtained from onDraw), but I get pDC->GetWindow as Null. No matter what if I send this window generated from pDC->GetWindow() function and try to print preview I see the graphs beings drawn outside the printpreview window. So any one knows how I can get a proper hwnd to send it to the 3rd Party function for printing it properly on Window.

Thanks for any help,
Kiran.


/***********************************
CDC* pdc;
HWND hwnd = m_hWnd;
if(pDC != NULL) {
if(pDC->GetWindow() != NULL) {
hwnd = pDC->GetWindow()->GetSafeHwnd();
} else {
AfxMessageBox("pDC->GetWindow() is null",MB_OK);
}

} else {
AfxMessageBox("pDC is null Using default m_hWnd",MB_OK);
}

Draw(m_lpMolecule, hwnd, rect, generateCoords,
hydrogenDisplay, kekuleDisplay);
***************************************/
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top