Learning

导航

2011年7月6日 #

VC中获得当前运行的全局应用对象APP的方法

摘要: ////////////////////////正确获得APP指针(1)规范写法 CViewInDlgApp *m_App= ( CViewInDlgApp*)AfxGetApp();//CViewInDlgApp是工程中App类 m_App->str1="test";//使用App中已定义的字符串变量 AfxMessageBox(m_App->str1); ////////////////////////正确获得APP指针(2)简写(( CViewInDlgApp*)AfxGetApp())->str1="test";//使用App中 阅读全文

posted @ 2011-07-06 10:36 xinjie 阅读(283) 评论(0) 推荐(0) 编辑