【发布时间】:2020-03-21 08:32:47
【问题描述】:
我已经按照clear documentation 实现了一个输入对话框。它工作正常。但是,现在我想在用户单击取消时忽略用户输入。以下是该文档的引用。
“如果用户点击OK按钮,InputQuery返回True;InputQuery返回False否则。”
所以,我尝试了以下代码,当我在 Win32 上运行时得到的错误是 E2034 Cannot convert void to bool,在 Android 上运行时是 bccaarm error 1711 value of type void is not contextually convertible to bool。
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 */;
【问题讨论】:
标签: firemonkey c++builder c++builder-10.3-rio