我已经按照明确的文档来实现输入对话框。它工作正常。但是,现在我想在用户单击取消时忽略用户输入。以下是该文档的引用。
“如果用户单击确定按钮,InputQuery返回True
;否则InputQuery返回。”False
所以,我尝试了以下代码,我得到的错误是E2034 Cannot convert void to bool
当我在 Win32 和bccaarm error 1711 value of type void is not contextually convertible to bool
Android 上运行时。
if (InputQuery(caption, Prompts, sizeof(Prompts)/sizeof(Prompts[0]) - 1, Defaults, sizeof(Defaults)/sizeof(Defaults[0]) - 1, (TInputCloseQueryProc *)Met)){
// clicked OK
} else {
// clicked cancel
}
我如何测试是否OK
或Cancel
点击?下面是声明InputQuery
,它应该是布尔值。我很困惑。
extern DELPHI_PACKAGE bool __fastcall InputQuery _DEPRECATED_ATTRIBUTE1("Use FMX.DialogService methods") (const System::UnicodeString ACaption, const System::UnicodeString *APrompts, const int APrompts_High, System::UnicodeString *AValues, const int AValues_High, const _di_TInputCloseQueryFunc ACloseQueryFunc = _di_TInputCloseQueryFunc())/* overload */;