问题描述
MSDN 上的 MsiProcessMessage 函数 doco 展示了这个例子:
The MsiProcessMessage function doco on MSDN shows this example:
PMSIHANDLE hInstall;
PMSIHANDLE hRec;
MsiProcessMessage(hInstall,
INSTALLMESSAGE(INSTALLMESSAGE_ERROR|MB_ABORTRETRYIGNORE|MB_ICONWARNING),
hRec);
如何在 DTF 中使用 Session.Message 来完成这项工作?唯一的重载将 Session.InstallMessage 作为参数.我看到了 MessageBoxButtons 枚举,我将这两种类型都转换为 In32 并执行逻辑或,但我不确定如何将其返回到 API.
How would this be done using Session.Message in DTF? The only overload takes Session.InstallMessage as an argument. I see the MessageBoxButtons enum and I convert both types to In32 and perform a logical or but I'm not sure how to get this back into the API.
是我遗漏了什么还是 DTF 遗漏了什么?
Am I missing something or is DTF missing something?
推荐答案
我对 DTF 做的不多,但我的理解是你想要这样的东西:
I've not done much with DTF but my understanding is that you'd want something like:
Session.Message(InstallMessage.Error |
(InstallMessage)((int)MessageButtons.AbortRetryIgnore |
(int)MessageIcon.Warning),
record);
不是很漂亮.我已经格式化了 messageType
agument 以更好地适应此处的文本框.根据您的编码指南格式化您的代码.:)
Not very pretty. I've formatted the messageType
agument to fit better in the text box here. Format in your code as per your coding guidelines. :)
这篇关于使用 DTF 的消息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!