Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

andrewcw

CString concatenation advice pls

This topic is 5214 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

One of my functions must take html from browser and rebuild for printing ( the orig files are XML )-- char by char and replace unicode with enities. I have to do this because the legacy code is not complied with the unicode version of MFC. While my code works, I dont know if CString is very efficient at concatenation ( should I be using another way ). The file size ranges between a few KB to 120 KB with an average of 30 KB. Also printing is not a typical function so a small wait is not that much of an issue. I did not find much about the topic ( unlike VB and C# for optimizing string building ). Here''s the major part of that work.... your opinion ?? Thanks long NUM_LOOP= SysStringLen(bstrHTML); for(long i=0; i256) { strFormat.Format("%d",charNum); theEntity="&#"+strFormat+";"; reBuildHTML+=theEntity; } else { char test = *ptrHTML; // code almost always goes through here. reBuildHTML+= test; } ptrHTML++; } // end of for loop return reBuildHTML; andrew

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by andrewcw
One of my functions must take html from browser and rebuild for printing ( the orig files are XML )-- char by char and replace unicode with enities. I have to do this because the legacy code is not complied with the unicode version of MFC.

While my code works, I dont know if CString is very efficient


Why don''t you try running it on a sample of your data, and see if it runs acceptably fast?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!