GUI demo: fixes, added VS2013 config, x64
authorPavel A <pavel_a@live.com>
Fri, 16 Jan 2015 09:02:58 +0000 (11:02 +0200)
committerPavel A <pavel_a@live.com>
Fri, 16 Jan 2015 22:17:40 +0000 (00:17 +0200)
.gitattributes
windows-vs/.gitignore [new file with mode: 0644]
windows-vs/VS_GUI_demo/GUIapp.cpp

index 186bca1f3e9790a070e63b04617942ab6d8756b4..7dcd312652f271fafb840b8cd4dc4a5239e2e416 100644 (file)
@@ -12,4 +12,5 @@
 *.bat eol=crlf
 *.txt eol=crlf
 *.c eol=lf
+*.cpp eol=lf
 *.h eol=lf
diff --git a/windows-vs/.gitignore b/windows-vs/.gitignore
new file mode 100644 (file)
index 0000000..64db12f
--- /dev/null
@@ -0,0 +1,4 @@
+**/Debug/
+**/Release/
+**/x64/
+**/*.cache
index 1497ed6bd4b0f33e29fc40a4605365cf9605db20..7fa6c100df092989b17d0ccab21e53e64019428a 100644 (file)
@@ -85,7 +85,11 @@ System::Void Form1::buttonOpen_Click(System::Object^  sender, System::EventArgs^
          // Get and show state:
       //BUGBUG g_dev is not usb_relay_device_info* in the orig library! use my new f()  ?? use only info in the list?
          struct usb_relay_device_info* di = (struct usb_relay_device_info*)g_dev;
-         int numChannels = (int)di->type;
+         int numChannels = (unsigned char)di->type;
+      if ( numChannels > MaxRelaysNum ||  numChannels == 0) {
+           // oops?
+           numChannels = MaxRelaysNum;
+      }
          g_chanNum = numChannels;
          unsigned st = 0;
          int r = usb_relay_device_get_status( g_dev, &st);