Well there's nothing like starting with a biggie, my first real, grown up post:
I'm using M$ Visual C++ 6 (Because I got a free copy with my textbook, and I'm still a student) and am trying to make a GUI app to run on windows. It's a classic student exercise, simple banck account type affair, bit of inheritance, bit of file IO (not allowed to use a database). Just a class with a load of attributes and set and get functions, with all the instances either in the file, and/or in a linked list. The GUI pretty much just displays the lists and lets you fill in attributes.
Anyway the point: I have to use strings for most of teh attrobutes, name, address etc, and am having dificulty with them. c-style char arrays would be fine, but they seem to be a real pain to use when you have to verify data, for example make sure there are no characters you don't want that might muck things up.
The STL (Standard template library) strings look like they would be good, but Microsoft doesn't seem to like supporting them.
Microsofts MFC CString seems to be very polarised, people either love it, or hate it. I'm prepared to love it, but can't get them to work. I've got a function that is supposed to return a CString, which I then try to assign to another CString I have ready, but I get a compiler error saying that it cannot convert from a CString to a Char*.
Two things about that error irk me, one I'm not trying to, I'm trying to assign one CString object the value of anotherCString object. And secondly, there should be an overloaded assignment operator for CString to Char* (c-style char arrays), surely that's pretty elimentary. Unless Microsoft are trying to avoid bloat, which isn't very characteristic.
Right, sorry about the length and complexity of that, Please let me know if I've exceeded the bounds of this category.
Also, please don't tell me to use Borland, GCC or whatever. Visual C++ is what I've got, and it's probably the easiest thing to write a windose GUI in. I doubt I'll write another for years.
Thanks,
Andrew.


LinkBack URL
About LinkBacks
Reply With Quote