写了下面一段程序,想看看两个变量的值,插进两个messagebox(),为什么第二MesaageBox()不执行?而在vc中可以显示两个对话框。编译没有错误。请各位指教!
int nIndex1 =m_kanghun.GetCurSel();
int ni;
CString stri;
ni = m_kanghun.GetLBTextLen(nIndex1);
m_kanghun.GetLBText(nIndex1, stri.GetBuffer(ni));
MessageBox((LPCTSTR)stri);
char *ss;
wcstombs(ss,(LPCTSTR)stri,20);
short int kanghun=(short int)atoi(ss);
int nIndex =m_fenxipinlv.GetCurSel();
int n;
CString str;
n = m_fenxipinlv.GetLBTextLen(nIndex);
m_fenxipinlv.GetLBText(nIndex, str.GetBuffer(n));
MessageBox((LPCTSTR)str);
char *sd;
wcstombs(sd,(LPCTSTR)str,20);
short int fenxipinlv=(short int)atoi(sd);
CString stri;
ni = m_kanghun.GetLBTextLen(nIndex1);
m_kanghun.GetLBText(m_kanghun.GetCurSel(),stri);
MessageBox(stri);
short int kanghun=(short int)_wtoi(stri);
CString str;
m_fenxipinlv.GetLBText(m_fenxipinlv.GetCurSel(),str);
MessageBox(str);
short int fenxipinlv=(short int)_wtoi(str);
//------------------------------------
wince4.2 emulator 测试通过...