• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

CString vs STL wstring

Started by James C. Fuller, December 07, 2014, 02:55:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

James C. Fuller

Patrice,

  What were your reasons on using STL strings instead of native VC++ CString?

James

Patrice Terrier

Most of the time i am using UNICODE in C++, aka wstring or WCHAR.

WSTRING is for the ease of use, but dealing directly with WCHAR produces smallest code.

And i don't want to use ATL/MFC to reduce the size of the embedded CRT.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

James C. Fuller

Patrice,
  That's a big DUH on my part.
I've been spending way too many hours trying to get a handle on mfc, forgetting that CString is in fact part of mfc.

James

Frederick J. Harris

Do you really like MFC James?  If you were to come into my house and look at computer programming books lying around, you would think I'm huge into .NET and MFC.  But the sad fact is that the reason I have so many books on those subjects is because I found them so difficult and problematic.   

James C. Fuller

Fred,
  I like the concept of the mfc but the implementation via Visual Studio completely turns me off.
Way too many hidden items going on in the background. The biggest problem I have found is finding demos that will load with Visual Studio 2013 Community.
I am understanding it bit by bit but am coming to the conclusion that gui encapsulation can be better served with wxWidgets.
The App's will be bigger than mfc but ....
WxWidgets has a nice grid. I could not find a "free" mfc grid that measures up to it.
I don't have a working VC++ <-> wxWidgets setup to test even though I do have the VC++ libraries.
I still think one is better off using TDM-GCC with wxWidgets just in case there is Linux in their future.
It's a rock solid distro that I believe was used to build code:blocks.

James


Frederick J. Harris

Quote
Way too many hidden items going on in the background.

That was exactly my impression also.  All those confusing macros doing things like setting up message handlers and so forth.  I do have several decent MFC books (old) I'd be happy to give you if you would help with the shipping.  I really don't see myself getting interested in it again.  Back in the late 90's I was though.  The big heavy book is Jeff Procesis or something like that from Microsoft Press.  Then I have a couple others too.

If I was into Linux I believe I'd look into wxWidgets.  The last coding I was doing in Linux was with GTK.

James C. Fuller

Fred,
  Thanks for the offer but I picked up Jeff's book (used) for just a few bucks on Amazon.
I also had an old SAM's teach yourself Visual C++ 6 in a half hour :)
I did find another pdf on line that also helped a bit.
They all focus (as they should) on the Visual Studio VC++ implementation. I have been able to learn quite a bit from reading a lot of the VS log output files.
I have a lot of working code bc9Basic -> c++  compiled with a new batch file just for VS 2013 Community mfc.

I have looked at other Frameworks Win32++ for instance but I think wxWidgets is good even if you have no interest in Linux.
Qt is another VERY popular Framework.

Yes it all can be done without a Framework but I like the encapsulation using much better code than I could ever write.

Also I have my UbxWx translator for both Windows and Linux 32/64. Sorry couldn't help the plug :)

James


Brian Alvarez

#7
This is very interesting stuff!!. Do you think it would be possible for you to make a post about BSTR's?

:)