m_szProductDesc1有很多行,richedit 只有一行

RT,VS2008里面richedit对应的value:m_szProductDesc1有很多行,但是richedit只显示第一行,在循环里打m_szProduct+=m_szOut+"\n",调试的时候看见m_szProductDesc1有很多数据,但显示出来就只有一行。
而且后来我把m_szProductDesc1放进循环,它显示了两次循环的结果,结果也是在同一行,没分行



void CtracewhereDlg::GetAllRouteDesc()
{

CString szDBFile,szADOConnStr;
char szCurDir[256]="c:\\";
GetCurrentDirectory(255,szCurDir);
if(szCurDir[strlen(szCurDir)-1] != '\\')
strcat(szCurDir,"\\");
szDBFile = szCurDir;
szDBFile += "ip.mdb";
szADOConnStr.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s",szDBFile);
CADODatabase db;
if(!db.Open(szADOConnStr))
// return FALSE;
AfxMessageBox("ERROR!");
CString szOut;
for(int i=0;i<glo_arrRoute.GetUpperBound()+1;i++)
{
CString szSQL,szCountry,szLocal;
CADORecordset rs(&db);
szSQL.Format("select * from wry where startip<='%s' and endip >='%s' order by startip desc",glo_arrRoute[i],glo_arrRoute[i]);
glo_arrIPSite.Add("N/A");
if(!rs.Open(szSQL,CADORecordset::openQuery))
continue;
if(rs.IsEOF())
continue;
rs.GetFieldValue("country",szCountry);
rs.GetFieldValue("local",szLocal);
rs.Close();
glo_arrIPSite.ElementAt(i)=szCountry +" " + szLocal;

szOut += glo_arrRoute[i];
szOut += glo_arrIPSite[i];
szOut += "\n";
UpdateData(false);

//TRACE("%s %s\n",glo_arrRoute[i],glo_arrIPSite[i]);
m_szProductDesc1+=szOut+"\n";

}
m_szProductDesc1+=szOut+"\n";
UpdateData(false);
//return TRUE;


}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值