Tremorblue
Programmer
Ansi string to widestring conversion..
Why does this work using ansistring ?
char s[20],t[20];
AnsiString aW;
strcpy(s,t); // Works
strcpy(s,aW.c_str()); Works.
And this does not work using widestring ?
wchar_t s[20],t[20];
WideString aW;
wcscpy(s,t); // This works
wcscpy(s,aW.c_bstr()); // This crashes.
Why does this work using ansistring ?
char s[20],t[20];
AnsiString aW;
strcpy(s,t); // Works
strcpy(s,aW.c_str()); Works.
And this does not work using widestring ?
wchar_t s[20],t[20];
WideString aW;
wcscpy(s,t); // This works
wcscpy(s,aW.c_bstr()); // This crashes.