iwolf
  • iwolf
  • Aficionado Topic Starter
Tuesday, April 26, 2005 8:46:00 AM
hey i would guess that their is a programmer or two one this forum. i have a problem i know u can convert a string to a Cstring in mfc using c++, but is their a way to convert a Cstring to a string maybee a function or something??
cexshun
Tuesday, April 26, 2005 8:49:00 AM
Never used strings in C/C++. The string.h header (or whatever it is) is full of security holes and buffer problems. I've always used character arrays, in which case the conversion would be pretty simple.
dwallen
Tuesday, April 26, 2005 9:41:00 PM
iwolf,

Not sure if this is what you're looking for, but:

CString foo;

TCHAR cNastyBuffer[2048]; // we hope it is long enough

cNastyBuffer[0] = '\0'; // probably not needed with today's compilers

strcpy(cNastyBuffer, foo);

VC++ 6.0's version of CString had a GetBuffer() method that could also be useful, but that's not coming up in VS2003's help docs for CString.

Buddha Daddy
Tuesday, April 26, 2005 10:50:00 PM
E=mc2?
tpottiger
Wednesday, April 27, 2005 1:28:00 AM
Substitute the C string for a G string, but only if she will look good in, (or out,) of it...
iwolf
  • iwolf
  • Aficionado Topic Starter
Wednesday, April 27, 2005 9:50:00 AM
thanx much guys

it turned out to be one of those

ive been coding for hours

why wont it WORK

STUPID THING I'LL THROW YOU, THEN WELL SEE WHO IS IN CONTROL!!!!!

thanx again

bud451
Wednesday, April 27, 2005 10:40:00 AM
Might be the flux capacitor 😉