CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 18

Threaded View

  1. #5
    Join Date
    Mar 2013
    Posts
    9

    Re: String passing between functions in VC++ SDI application

    Hi! this is the complete code which i hav done untill now

    Code:
    Void sendtext()
    {
      CTreeCtrl&  trCtrl = GetTreeCtrl(); 
      HTREEITEM hItem,hsc; 
      CExerciseDoc *pDoc = GetDocument();
    
    CString pathname,strLine; 
    CString filename;
    CFileDialog dlg(TRUE);
    dlg.DoModal();
    if(dlg.DoModal() == IDOK)
    {
         pathname=dlg.GetPathName(); // return full path and filename
    }
    
    CStdioFile File;
    
    if(File.Open(pathname, CFile::modeRead)) // Open file to be read 
    { 
    
         while(File.ReadString(strLine)) // Read file 
              { 
                     int Position = 0; 
                     CString Token; 
    
                     CAtlString str(strLine);
                     CAtlString resToken,resToken1;
    
                     resToken = str.Tokenize(_T("-:, "), Position); //A,B
         pDoc->pSendview->displaytext(resToken);
         if(resToken != (_T(""))) // Empty File Check
    
         hItem = trCtrl.InsertItem(resToken , 0, 2 );
    
                     while(resToken!="") 
                     { 
    
                       resToken = str.Tokenize(_T("-:@, "), Position);
                     }
                }
            }
         }
      }
        void CRightView::displaytext(CAtlString league)
        {
       CListCtrl &ctlRightView = this->GetListCtrl();
       ResetLeagues();
       CAtlString resToken;
       ctlRightView.InsertColumn(1,  _T("First "),   LVCFMT_LEFT,   80);
       ctlRightView.InsertColumn(1,  _T("Second "),   LVCFMT_LEFT,   80);
    
             int nItem;
       nItem = ctlRightView.InsertItem(0,  league);
       ctlRightView.SetItemText(nItem, 1,  league);
        }
    Last edited by maxer; April 8th, 2013 at 06:25 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured