问题是sw_version[50]值怎么不是"0"
我设置了断点,断点是按以下步骤执行的第一步:
BOOL CLCDDlg::OnInitDialog()
{
CDialog::OnInitDialog();
pmech->InitMech(this);}
第二步:BOOL CMechanism::InitMech(CWnd* pPortOwner)
{
Ptre = pPortOwner;
memset(sw_version,0,sizeof(sw_version)); return 1;我设置了断点到这里看了sw_version 值为全部"0";
}第三步:
BOOL CMyTabPage3::OnInitDialog()
{
CDialog::OnInitDialog();
InitMechBaiscInfor();
return 1;}第四步:
void CMyTabPage3::InitMechBaiscInfor()
{ UCHAR *get_version;
CMechanism mech;
UCHAR i;
get_version=mech.inspect_cd_basic_info(DISP_SW_VERSION); }第五步:
UCHAR *CMechanism::inspect_cd_basic_info(UCHAR baisc_info)
{ switch (baisc_info)
{
default:
return NULL;
break; case DISP_SW_VERSION:
return sw_version; //已经初始化过了,但里面的值变成了240 break;
}}
没任何别的地方调用
如下:
Searching for 'get_version'...
C:\Documents and Settings\Administrator\桌面\Lcd-2\MyTabPage3.cpp(59): UCHAR *get_version;
C:\Documents and Settings\Administrator\桌面\Lcd-2\MyTabPage3.cpp(63): get_version=mech.inspect_cd_basic_info(DISP_SW_VERSION);
C:\Documents and Settings\Administrator\桌面\Lcd-2\MyTabPage3.cpp(65): if(get_version[0])
C:\Documents and Settings\Administrator\桌面\Lcd-2\MyTabPage3.cpp(67): SetDlgItemInt(IDC_SW_VERSION,get_version[i]);
4 occurrence(s) have been found.
我设置了断点,断点是按以下步骤执行的第一步:
BOOL CLCDDlg::OnInitDialog()
{
CDialog::OnInitDialog();
pmech->InitMech(this);}
第二步:BOOL CMechanism::InitMech(CWnd* pPortOwner)
{
Ptre = pPortOwner;
memset(sw_version,0,sizeof(sw_version)); return 1;我设置了断点到这里看了sw_version 值为全部"0";
}第三步:
BOOL CMyTabPage3::OnInitDialog()
{
CDialog::OnInitDialog();
InitMechBaiscInfor();
return 1;}第四步:
void CMyTabPage3::InitMechBaiscInfor()
{ UCHAR *get_version;
CMechanism mech;
UCHAR i;
get_version=mech.inspect_cd_basic_info(DISP_SW_VERSION); }第五步:
UCHAR *CMechanism::inspect_cd_basic_info(UCHAR baisc_info)
{ switch (baisc_info)
{
default:
return NULL;
break; case DISP_SW_VERSION:
return sw_version; //已经初始化过了,但里面的值变成了240 break;
}}
没任何别的地方调用
如下:
Searching for 'get_version'...
C:\Documents and Settings\Administrator\桌面\Lcd-2\MyTabPage3.cpp(59): UCHAR *get_version;
C:\Documents and Settings\Administrator\桌面\Lcd-2\MyTabPage3.cpp(63): get_version=mech.inspect_cd_basic_info(DISP_SW_VERSION);
C:\Documents and Settings\Administrator\桌面\Lcd-2\MyTabPage3.cpp(65): if(get_version[0])
C:\Documents and Settings\Administrator\桌面\Lcd-2\MyTabPage3.cpp(67): SetDlgItemInt(IDC_SW_VERSION,get_version[i]);
4 occurrence(s) have been found.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货