Windows Mobile 编程问题之外的思考
2010-10-20 08:01:33 来源:WEB开发网SplitCString(iszString,*strArray,L" ");
textsize = GetDC()->GetTextExtent(L"股");
int textNumber = lineWidth/textsize.cx;
for(int j = 0;j < strArray->GetSize();j++)
{
splitStr = strArray->GetAt(j);
int columeNumber = splitStr.GetLength()/textNumber+((splitStr.GetLength()%textNumber)>0?1:0);
if(columeNumber == 0)
{
STOCKRANGE inforDetailContent;
inforDetailContent.stockCode = splitStr;
inforDetailContent.decimalNumber = ++wordNumber;
StockRangeData.push_back(inforDetailContent);
STOCKRANGE blankContent;
blankContent.stockCode = L"";
blankContent.decimalNumber = ++wordNumber;
StockRangeData.push_back(blankContent);
continue;
}else
{
for(int i = 0;i < columeNumber;i++)
{
STOCKRANGE inforDetailContent;
if(splitStr.GetLength() > textNumber)
{
inforDetailContent.stockCode = splitStr.Left(textNumber);
splitStr = splitStr.Right(splitStr.GetLength()-textNumber);
inforDetailContent.decimalNumber = ++wordNumber;
StockRangeData.push_back(inforDetailContent);
}else
{
inforDetailContent.stockCode = splitStr;
inforDetailContent.decimalNumber = ++wordNumber;
StockRangeData.push_back(inforDetailContent);
STOCKRANGE blankContent;
blankContent.stockCode = L"";
blankContent.decimalNumber = ++wordNumber;
StockRangeData.push_back(blankContent);
}
continue;
}
}
}
在使用新的方法之后,资讯文本内容的解析速度大为提升,或许这并不是技术上的问题,而是愿意不愿意多思考的问题!
更多精彩
赞助商链接