Hi,
I have the code:
CString buf;
buf.Preallocate(255);
GetWindowText(GetForegroundWindow(), buf.GetBuffer(), 255);
int Bracket = buf.Find("[");
char p = buf.GetAt(Bracket+1);
buf is: "SONAR X1 Producer - [Two Track.cwp - Track]"
Bracket is: 20 - So it found the '[' character.
I want p to be 'T'
All I get for my trouble is an assertion in atlsimpstr.h at line:
ATLASSERT( (iChar >= 0) && (iChar <= GetLength()) ); // Indexing the '\0' is OK
iChar is 21 and less than the string length.
What the diddly hoo could be my problem?