Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. crashes when I pass data from dialog to View, Need help!

crashes when I pass data from dialog to View, Need help!

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++announcement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Ibana
    wrote on last edited by
    #1

    :(Hi there! I have MFC app (doc/view). In that app I have a dialog with a combobox from which I want to transfer a selected item back to the main View Class where I have a VTK(Visualization toolkit) window. basically Selecting an item in the combobox should affect the object that Im displaying in my main View when I execute my application and select the "Dialog" and select a string in the combobox it crashes and points at the member in the View class that I want to change. Below is the code where I change a variable in the View method SetScalars. I was wondering if it had to do with that my dialog is modal so that it cant overwrite my view class members , because that seems to be the problem. John, that line "alot of functions and members.... " are just VTK (vizualization toolkit) stuff. [CODE] void CStressesDialog::OnDropDownSelchange() { int idx = m_DropDown.GetCurSel(); if( idx < 0 ) return; CWnd* pParent = GetParent(); CVtkSDIView* pView = (CVtkSDIView*)pParent; pView = (CVtkSDIView*)pParent; CString str; m_DropDown.GetLBText( idx,str ); pView->SetScalars(str); } [/CODE] This is what causes the crash somehow this->str_select = s; where str_select is an Cstring. [CODE] void CVtkSDIView::SetScalars(CString s) { this->str_select = s; //VTK STUFF IN THIS FUNCTION.. this->filereader->SetScalarsName(str_select); this->filereader->Update(); this->lut->SetTableRange(this->filereader->GetOutput()->GetScalarRange()); this->lut->Build(); this->band->GenerateValues(15,this->filereader->GetOutput()->GetScalarRange()); this->band->Update(); this->pMapper->SetScalarRange(this->filereader->GetOutput()->GetScalarRange()); this->pMapper->Update(); this->renWin->Render(); this->iren->Start(); } [/CODE] Thanks for your help! /regards peter

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups