ApxString - MFC CString Replacement
Posted
by James Bernard Schumacher III
on September 19th, 2001
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.

Comments
As the below comment states....
Posted by DyneFire on 07/20/2005 08:13pmPlease 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...).
ReplyDo not use tis implementation, contains many bugs!
Posted by dtobler on 09/06/2004 04:00amThere 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.
-
Replycstring
Posted by dandi on 02/19/2007 04:25amcstring
ReplyNew, rewritten version of ApxString.....
Posted by Legacy on 06/06/2003 12:00amOriginally 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
ReplyVery Useful
Posted by Legacy on 10/21/2002 12:00amOriginally posted by: Thomas gruebr
ReplyAvailable....
Posted by Legacy on 10/13/2002 12:00amOriginally posted by: James Bernard Schumacher III
http://jbschumacher.50megs.com/cpp/projects/apxstring/
ReplyThis article is OUTDATED....
Posted by Legacy on 09/28/2002 12:00amOriginally posted by: James Bernard Schumacher III
Replyactivex control...
Posted by Legacy on 10/03/2001 12:00amOriginally 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
Replywhat's the advantage?
Posted by Legacy on 09/21/2001 12:00amOriginally 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:00amOriginally 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.
ReplyYet another "good for nothing" string class with no UNICODE support.
Posted by Legacy on 09/19/2001 12:00amOriginally 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