ApxString - MFC CString Replacement

Environment: VC6 SP5, Win98 SE

ApxString is a C++ string class that I wrote to make Windows programming more enjoyable without the use of MFC's CString class. With the a few exceptions, I wrote this code entirely myself, and it has no dependency whatsoever on MFC. The project is a Win32 *.dll, with all source included. The class is ref counted, and makes use of many globals that I wrote myself. It even makes use of an encryption algorithm that I found on Codeguru! This code has no dependency on outside libraries except for 2 calls into the CRT, (strstr & _vsnprintf) the rest of the globals reside within this project.

Downloads

Download source - 21.7 KB


Comments

  • As the below comment states....

    Posted by DyneFire on 07/20/2005 08:13pm

    Please do not use this version of the ApxString class. This version is a VERY EARLY write of the class when I first began programming. I have since rewritten the class several times, and all 'known' bugs known to me have been fixed. I will post a link to a new version of this string library in the future when I find a suitable host (along with more classes for file i/o etc...).

    Reply
  • Do not use tis implementation, contains many bugs!

    Posted by dtobler on 09/06/2004 04:00am

    There are various bugs in this code, e.g. myString = ""; CPPUNIT_ASSERT(myString.IsEmpty()==true) // FAILS!!! GetBuffer() overwrites trailing '\0' etc. In addition, the implemention is not reentrant, see static variables. We took Wtl::CString instead, which is also a very good alternative to CString.

    • cstring

      Posted by dandi on 02/19/2007 04:25am

      cstring

      Reply
    Reply
  • New, rewritten version of ApxString.....

    Posted by Legacy on 06/06/2003 12:00am

    Originally posted by: James Bernard Schumacher III

    I lost the source code to my latest code base, so I had to rewrite the whole class. The new version of ApxString is compiled via GCC 3.2 - YAY!

    As always, ApxString can be found at: http://jbschumacher.50megs.com/cpp/projects/apxstring

    Reply
  • Very Useful

    Posted by Legacy on 10/21/2002 12:00am

    Originally posted by: Thomas gruebr

    That's a nice string class. but some there are some operators missing (<, <= ...).
    
    how much would the fee be to get the source? i can't load dlls in my embedded system.

    Reply
  • Available....

    Posted by Legacy on 10/13/2002 12:00am

    Originally posted by: James Bernard Schumacher III

    http://jbschumacher.50megs.com/cpp/projects/apxstring/

    Reply
  • This article is OUTDATED....

    Posted by Legacy on 09/28/2002 12:00am

    Originally posted by: James Bernard Schumacher III

    I have a much better version written as of this writing. It has only one dependency on any outside library - and that's _vsnprintf from the CRT library.
    
    

    I have copyrighted the latest version - but as long as your application is freeware, there's no problem. Also, if you modify it by atleast 10% - I don't require any royalties on commercial applications.

    Just ask and I'll put it up somewhere. (Plus, this new version has less bugs, alot less)

    I would change the article, except for the fact I forgot my password for it.

    Reply
  • activex control...

    Posted by Legacy on 10/03/2001 12:00am

    Originally posted by: phililp

    Good day sir!

    i just want to ask from you about the use of "VARIANT". how can i use this data type for me to return an array of string in my method (activeX control), or is there another way to solve this issue.

    thank you

    philip

    Reply
  • what's the advantage?

    Posted by Legacy on 09/21/2001 12:00am

    Originally posted by: anonymous

    I admire the desire to rewrite things from scratch.

    However, the code makes uses of globals and static members for no apparent reason whatsoever. The code is not thread safe, fatter, doesn't support unicode, doesn't provide for operators to directly access CString or std::string. It is also pretty much Windows and MSVC oriented given it uses pragmas and __cdecl. It unnecessarily provides for a new/delete operator but then uses Windows-specific calls to handle memory. No attempt was made to rewrite FormatV() so it is does still require third party 'libraries' as well.

    One thing new was the ability to encrypt/decrypt. The algorithm is slow and arguments are passed by value though. The value 256 could have been a constant or define and some of the loops could have been merged.

    Compared to much of the code on this website, it does appear to be the work of somebody who just learned C++ and is very proud of it. I hope the author continues his quest to better understand current implementations and hopefully he'll be able to provide us with more useful and insighful classes in the future.

    Reply
  • Updated version (with Unicode variant) and....

    Posted by Legacy on 09/20/2001 12:00am

    Originally posted by: James Schumacher

    classes for small strings (256 chars and less) will be available soon.

    Actually, I uploaded this class several months ago, and it's taken until now to get it posted, so this release is actually quite outdated. This class and it's variants (ApxWString, ApxStackString, & ApxWStackString) have all been updated with more member functions, and a few of them have been rewritten reducing overhead. I will upload them soon.

    Reply
  • Yet another "good for nothing" string class with no UNICODE support.

    Posted by Legacy on 09/19/2001 12:00am

    Originally posted by: Igor Soukhov

    If you want a string class that can be ported anythere and have no dependency at all - use STANDARD string class from STL.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • On-demand Event Event Date: September 10, 2014 Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild." This loop of continuous delivery and continuous feedback is how the best mobile …

  • According to a recent Forrester total economic impact (TEI) study, enterprises can see a significant reduction in total cost of ownership by accessing Oracle Database in the cloud with a pay-as-you-go subscription model. This subscription service gives businesses the ability to scale up application environments for rapid prototyping, with far less time devoted to procuring licenses and deploying IT infrastructure. Read this study to learn how three different companies use Oracle Database in the cloud and the …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds