Purpose of MFC SDI: read a text file having floating values with tab separated not comma
I added a menu Contour plot menu and 1. colour and 2. Gray Scale as sub menu. On pressing Colour a dialog box appears, whose purpose is to browse a text file. I browse and selct it and the path is visible in an EDIT box beside the browse button
and a plot button in dialog box to plot on the SDI window.
I am successful in browsing and selecting the text file. When I click plot button it should read and further porcess it which i am not able to implement. I ahve the logic to process it. I need to read the text file and store the floating point values in an 2D array. Anyone can help me please. its urgent!!
Dialog box picture looks somewhat like this
void CColourdlg::OnPlot() //PLOT BUTTON
// TODO: Add your control notification handler code here
ifs.open(m_path,ios::nocreate); //m_Path is a variable atached
//to edit box but i am not able
// to get the path of the txt fil
while (std::getline(is, line)) // read one line at a time
while (iss >> value) // read one value at at time from the line
; // do something with the value
When i click the dialog box open and does processing and a 2D vector lies in the dialog pushbutton function. How do i send it to ONDRAW function defined in VIEW.CPP file There i will plot this vector in terms of pixels.. Can u please suggest me with small example code to be written in pushbutton() and ONDRAW().. I would be highly thankful to u.. Please help me out!