|
代码如下: 只要执行这里 内存就少4k 执行一次少一次
帮忙看看 什么问题 谢谢了
FILE *fhandle = fopen("buff.txt","a");
if( NULL == fhandle)
{
AfxMessageBox(_T("1"));
}
else
{
char pdquyu[120];
memset(pdquyu,0x00,sizeof pdquyu);
char pdother[23];
memset(pdother,0x00,sizeof pdother);
char pdotherquyu[5];
memset(pdotherquyu,0x00,sizeof pdotherquyu);
char pdothername[9];
memset(pdothername,0x00,sizeof pdothername);
char pdothercode[11];
memset(pdothercode,0x00,sizeof pdothercode);
char pdname[61];
memset(pdname,0x00,sizeof pdname);
char pdbarcode[14];
memset(pdbarcode,0x00,sizeof pdbarcode);
char pdnumber[5];
memset(pdnumber,0x00,sizeof pdnumber);
int i = m_pdquyu.GetLength();
WideCharToMultiByte(CP_ACP,0,m_pdquyu,-1,pdquyu,i,NULL,NULL); //
strcat(pdquyu,",");
int j = WideCharToMultiByte(CP_ACP,0,m_pdother,-1,pdother,j,NULL,NULL); //
WideCharToMultiByte(CP_ACP,0,m_pdother,-1,pdother,j,NULL,NULL); //
for(i = 0;i<4;i++)
pdotherquyu = pdother;
pdotherquyu[4] = '\0';
strcat(pdquyu,pdotherquyu);
strcat(pdquyu,",");
for(i = 0;i<8;i++)
pdothername = pdother[4+i];
pdothername[8] = '\0';
strcat(pdquyu,pdothername);
strcat(pdquyu,",");
for(i = 0;i<10;i++)
{
if(pdother[12+i] == ' ')
break;
else
pdothercode = pdother[12+i];
}
pdothercode = '\0';
strcat(pdquyu,pdothercode);
strcat(pdquyu,",");
i = m_pdbarcode.GetLength();
WideCharToMultiByte(CP_ACP,0,m_pdbarcode,-1,pdbarcode,i,NULL,NULL);
for(i=0;i<14;i++)
{
if(pdbarcode == ' ')
{
pdbarcode = '\0';
break;
}
}
strcat(pdquyu,pdbarcode);
strcat(pdquyu,",");
int k = WideCharToMultiByte(CP_ACP,0,m_pdname,-1,pdname,k,NULL,NULL); //
WideCharToMultiByte(CP_ACP,0,m_pdname,-1,pdname,k,NULL,NULL); //
for(i=0;i<60;i++)
{
if(pdname == ' ')
{
pdname = '\0';
break;
}
}
strcat(pdquyu,pdname);
strcat(pdquyu,",");
i = m_pdnumber.GetLength();
WideCharToMultiByte(CP_ACP,0,m_pdnumber,-1,pdnumber,i,NULL,NULL);
strcat(pdquyu,pdnumber);
strcat(pdquyu,"\n");
//fputs(pdquyu,fhandle);//最后写
}
fclose(fhandle);
m_pdother.Empty();
m_pdbarcode.Empty();
m_pddanjia.Empty();
m_pddanwei.Empty();
m_pdname.Empty();
m_pdnumber.Empty();
//m_pdquyu.Empty();
(CEdit*)GetDlgItem(IDC_PDbarcode_EDIT)->SetFocus();
UpdateData(false);
|
|