|
Hi all
I have a view class "CProcessView", where I create a new Window with the WindowCreateEx function:
void CProcessView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
...
m_hWndSubView = ::CreateWindowEx(WS_EX_CONTROLPARENT, OCT3DCLASS, "OCT3DProcessWnd",
WS_CHILD|WS_VISIBLE|WS_TABSTOP, rWnd.left, rWnd.top, rWnd.Width(), rWnd.Height(),
m_hWnd, NULL, AfxGetInstanceHandle(), NULL);
}
Now I want to get the content of this window (m_hWndSubView), to print it out. I try it like that, but the dc.Attach(myDC) results in an Assertion Failed alert in wingdi.cpp, line 109.
void CProcessView::OnFilePrint()
{
HDC myDC;
myDC = ::GetWindowDC(m_hWndSubView);
dc.Attach(myDC);
CFormView::OnFilePrintPreview();
}
I'm new to MFC stuff. But I need to get it working. Can anybody help. Thanks in advance
Adrian
|
|
|
|