随笔 - 34, 文章 - 3, 评论 - 10, 引用 - 0
数据加载中……

获取edit的值

void CRrrrView::OnButton1()
{
 // TODO: Add your control notification handler code here
 CString str;

 CMainFrame* pFram = (CMainFrame*)this->GetParent() ;

 // 任何指针使用前都要判断
 if ( pFram == NULL )
 {
  MessageBox("pFrame == NULL ") ;

  return ;
 }
 
 CEdit *pED   =   (CEdit   *)(pFram->GetDlgBar()->GetDlgItem(IDC_EDIT1));

 if ( pED == NULL )
 {
  MessageBox( "pED == NULL " ) ;

  return ;
 }
 
 pED->GetWindowText(str);

 if ( str == "" )
 {
  MessageBox( "pED == NULL " ) ;

  return ;
 }
 

 Navigate2(_T(str),NULL,NULL);

}
//在view里获取dialog中的edit的指针

posted on 2009-06-01 17:52 wsy6634 阅读(692) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理