[vtkusers] vtk application on Document/View (MDI) pattern.

de Boer Ingo I.deBoer at polytec.de
Thu Oct 28 04:18:54 EDT 2004


Hi Luis,

well, I guess the problem is, that you have to create the actuall
window before setting the handle to vtk, like:

BOOL CAnalitica3DBIView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
    BOOL bResult = CView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);

    if (bResult)
    {
     // TODO: Add your specialized code here and/or call the base class
     this->renWin->AddRenderer(this->ren);
     this->renWin->SetParentId(this->GetParent()->GetSafeHwnd());
     this->renWin->SetWindowId(this->GetSafeHwnd());
     this->iren->SetRenderWindow(this->renWin);
    }
         
    return bResult;
}

you can also take a look at my MFC samples:
http://www.vtk.org/Bug/bug.php?op=show&bugid=649&pos=0

greets
  Ingo

---
Dr.-Ing. Ingo H. de Boer

Polytec GmbH
Polytec-Platz 1-7, 76337 Waldbronn, Germany
phone: ++49 7243 604 106
fax  : ++49 7243 604 255

I followed your orientations and get this message:
Then , if I press Ignore, the execution application continue with same problem wich I related
 
 
BOOL CAnalitica3DBIView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
       // TODO: Add your specialized code here and/or call the base class
    this->renWin->AddRenderer(this->ren);
       this->renWin->SetParentId(this->GetParent()->GetSafeHwnd());
    this->renWin->SetWindowId(this->GetSafeHwnd());
       this->iren->SetRenderWindow(this->renWin);
              
       return CView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
}



More information about the vtkusers mailing list