Sorry for double post, but I could not find the edit button. Anyways, I fixed the search so I do not need help with the question above anymore. I do have a new question which has come up.
char * Serial = (char*)(LPCTSTR)PreSerial;
if (strlen(Serial) > 5) Serial[5] = 0;
// PreSerial = (CString)Serial;
char * Input = (char*)(LPCTSTR)m_Password;
if (Serial == Input) m_Warning.SetWindowText("Correct");
else m_Warning.SetWindowText(PreSerial);
}
Some reason whether I compare CString or Char* it always returns to the else statement. My question is, how do I compare the strings so the IF Else statement will work properly.
Other ways I have tried:
if (m_Password.Compare(PreSerial) == 0) //correct
else // invalid
Again it would always return invalid.
I have also tried char * MyVar = (char*)MyCstring.GetString() but that is the same as LPCTSTR.