COleDocObjectItem::OnPrint(this, pInfo, TRUE) ?
-
I have embed excel into my application and would like to overide my onprint function. Upon entry into this function pDC->m_hAttribDC; pDC->m_hDC; Are both NULL. the CDC* pDC however is not. If I try calling onPrint before an excel spreadsheet is open, then neither member is NULL. Only when I have an excel spreadsheet open are these members NULL. Why is this so? Sincerely, Mardigin
-
I have embed excel into my application and would like to overide my onprint function. Upon entry into this function pDC->m_hAttribDC; pDC->m_hDC; Are both NULL. the CDC* pDC however is not. If I try calling onPrint before an excel spreadsheet is open, then neither member is NULL. Only when I have an excel spreadsheet open are these members NULL. Why is this so? Sincerely, Mardigin
Okay I was able to get the hdc in the following manner
void CBPReportView::OnPrint(CDC* pDC, CPrintInfo* pInfo) { // TODO: add customized printing code here if(pInfo->m_bDocObject) { CDC * pOleDC = this->GetDC(); pDC->Attach(pOleDC->m_hDC); pDC->TextOut(100,100,"Muah ha ha h aa"); COleDocObjectItem::OnPrint(this, pInfo, TRUE); ReleaseDC(pOleDC); } else CView::OnPrint(pDC, pInfo); }
Only trouble is that "muah ha ha h aa" never shows up on my printed page, only the excel spreadsheet shows up. Any ideas? Mardigin