MessageBox doesn't show in Windows 7 Embedded
Asked Answered
D

2

5

Consider a MessageBox to prompt the user to answer yes or no. It works in our XP machines and one Windows 7 build machine.

However, it doesn't work on our Windows 7 Embedded machine. There is no error message, no MessageBox shows up. It just assumes the user clicked the Yes button because I can find the debug file created from there and createDatabase(); is called without any messageBox ahead of it.

I can find the assembly (System.Windows.Forms.dll) which is required by the MessageBox. It is in the same location as our Windows 7 build machine. do you have any idea why? thanks

DialogResult result = System.Windows.Forms.MessageBox.Show(
    "Do you want to update your database?\nWarning: All your data will be erased if you click Yes !",
"Update Database",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);

if (result == DialogResult.Yes)
{
    string[] cmdLines2 = { @"C:\AndeDB\AndeDB.db is here and selected yes" };
    //it will create, open and write or overwrite
    File.WriteAllLines(@"C:\Temp\dbcheck2.txt", cmdLines2);
    createDatabase();
}
Diann answered 11/11, 2010 at 21:33 Comment(0)
S
5

From this post, you could disable the "Message Box Default Reply" component from Windows 7 Embedded. Further details can be found on msdn.

Stockjobber answered 11/11, 2010 at 21:38 Comment(1)
Could u share solution for Windows XP pls?Barbabra
Z
4

The keyword here is "embedded". Such versions of Windows are often configured to run head-less (no monitor) or optimized to work without anybody being close. A MessageBox is poison to such a configuration. The machine stops running and nobody can find out why.

You need to go back to your system builder and find the option that controls this.

Zymometer answered 11/11, 2010 at 21:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.