Permalink
Browse files

AllocConsole for Win version

  • Loading branch information...
seuffert
seuffert committed Mar 14, 2011
1 parent 4163ff0 commit dd258c95409f7f68a254119a31ec36dfeee7d6e9
Showing with 11 additions and 1 deletion.
  1. +10 −1 XBSlink/CommandLine.cs
  2. +1 −0 XBSlink/XBSlink.csproj
View
@@ -6,6 +6,8 @@
using SharpPcap;
using SharpPcap.LibPcap;
using SharpPcap.WinPcap;
+using NDesk.Options;
+
using XBSlink.Properties;
namespace XBSlink
@@ -18,10 +20,15 @@ class xbs_console_app
public static xbs_node_list node_list = null;
private xbs_natstun natstun = null;
+ [System.Runtime.InteropServices.DllImport("kernel32.dll")]
+ private static extern bool AllocConsole();
+
public xbs_console_app(xbs_settings settings, String[] args)
{
+ if (System.Environment.OSVersion.Platform == PlatformID.Win32NT)
+ AllocConsole();
+
xbs_settings = settings;
-
output_version_info();
switch (args[0])
@@ -30,6 +37,8 @@ public xbs_console_app(xbs_settings settings, String[] args)
list_Devices(args);
break;
}
+
+ Console.ReadLine();
}
private void initialize()
View
@@ -95,6 +95,7 @@
<Compile Include="ExceptionMessage.Designer.cs">
<DependentUpon>ExceptionMessage.cs</DependentUpon>
</Compile>
+ <Compile Include="Options.cs" />
<Compile Include="xbs_cloudlist.cs" />
<Compile Include="xbs_chat.cs" />
<Compile Include="xbs_natstun.cs" />

0 comments on commit dd258c9

Please sign in to comment.