If someone is interested on the answer, I have already found the solution. The point is that on debug version, it iniatialize the variables correctly, however on release version, I must use CString terminate characters such as:
CString string1=string2 + "\0"
or if the string has to be empty, use the method of the class "string1.Empty()"; then with questions as if (!string1.IsEmpty()) it knows that is empty.