Skip to content

Commit

Permalink
fixed: display a nice error message if LibCecSharp failed to load
Browse files Browse the repository at this point in the history
  • Loading branch information
opdenkamp committed Dec 2, 2015
1 parent 99e5aa8 commit 9984e4b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/LibCecTray/Program.cs
Expand Up @@ -47,6 +47,8 @@ public static CECTray Instance
if (_instance == null)
{
_instance = new CECTray();
if (_instance == null)
throw new Exception("Failed to load libCEC. Check whether cec.dll is present in the same directory as LibCecSharp.dll");
_instance.Initialise();
}
return _instance;
Expand All @@ -61,7 +63,13 @@ static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(Instance);
try
{
Application.Run(Instance);
} catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
else
{
Expand Down

0 comments on commit 9984e4b

Please sign in to comment.