I am using the InputBox component in Embarcadero or Borland C++ with a default string. The Cancel key returns the same default string as the Enter button.
According to the documentation, the Cancel key is supposed to return an empty string.
String s = InputBox("Title", "Prompt", "Default");
if (s == "") return; // Cancel key pressed
... use string s
I have seen a solution using StrPtr in VB. Is there an equivalent in C++?
VB6 InputBox Cancel
I have found a solution that uses InputQuery instead of InputBox. The InputQuery functions returns FALSE if the Cancel button is selected. The DefaultString is returned on Enter.