摘要: 1.从注册表读取信息:代码如下:从注册表读取串口 1 void CCommDlg::EnumCommPort(CListBox *pListBox) 2 { 3 HKEY hKey; 4 if(ERROR_SUCCESS ==::RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Hardware\\DeviceMap\\SerialComm",NULL, KEY_READ, &hKey ))//打开串口注册表对应的键值 5 { 6 int i=0; 7 TCHAR RegKeyNa... 阅读全文
posted @ 2011-12-10 16:29 Irving314 阅读(4702) 评论(1) 推荐(1) 编辑
摘要: 从Eclipse IDE中,打开Help 菜单选择Install New Software,输入插件链接地址:http://avr-eclipse.sourceforge.net/updatesite/点Next,自动安装完成。 阅读全文
posted @ 2011-07-19 14:12 Irving314 阅读(882) 评论(0) 推荐(0) 编辑
摘要: 1.准备WINWVR下载安装最新版WINAVR,地址:http://winavr.sourceforge.net/index.html2.下载安装Eclipse C/C++下载地址:http://www.eclipse.org/downloads/,下载后解压无需安装可直接运行。3.下载安装Eclipse AVR插件下载地址:http://avr-eclipse.sourceforge.net/wiki/index.php/Plugin_Download,解压到Eclipse C/C++安装目录。此时,开发环境准备完毕,开始建立一个工程。File-->New->Project--& 阅读全文
posted @ 2011-07-18 22:09 Irving314 阅读(5105) 评论(1) 推荐(0) 编辑
摘要: 使用System.IO.Ports.SerialPort.GetPortNames()枚举可用串口并验证是否被占用,空闲串口添加到comobox1控件中显示。代码如下:验证可用串口 1 public bool IsPortOpen() 2 { 3 //create vars for testing 4 bool _available = false; 5 SerialPort _tempPort; 6 String[] Portname = SerialPort.GetPortNames(); 7 8 //create a loop for each string in SerialPort. 阅读全文
posted @ 2011-06-25 19:57 Irving314 阅读(10029) 评论(1) 推荐(2) 编辑
摘要: 串口作为最基本的电脑通信 I/O 接口,其使用虽然在 PC 上越来越少,但是在工业仪器领域仍然用的相当普遍,由于笔者工作中需要用到串口,而且发现枚举串口至今仍未搞得很清楚,为此自己先整理下,希望大侠和同行们对我不懂和错误的地方指点一下。 1 、查询注册表 查询注册表的方法是网上见到的比较常见的方法,该方法就是使用编程方法读取注册表内信息,相当于用户通过在运行框内输入 ”regedit” (或 regedit32 )直接打开注册表,查看“ HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM ”项来获取串口信息。以下是源代码: CString strS 阅读全文
posted @ 2011-06-25 16:23 Irving314 阅读(3841) 评论(0) 推荐(0) 编辑
摘要: button控件属性表:PropertyDescriptionAutoEllipsisSpecifies whether to append dots (…) when the text in the button is too long and can't fit the button.AutoSizeSpecifies whether the button will automatically resize to fit its content.FlatStyleDetermines the style of the button. Popup makes the button f 阅读全文
posted @ 2011-06-25 00:56 Irving314 阅读(1513) 评论(0) 推荐(0) 编辑
摘要: 默认值:Sizable。可供设置的FormBorderStyle 如下表:ValueDescriptionNoneThe form has no border.FixedSingleThe form has a non-resizable single line border.Fixed3DThe form has a non-resizable 3d border.FixedDialogThe form has a thick, non-resizable, dialog style border that has no minimize or maximize boxes.SizableT 阅读全文
posted @ 2011-06-25 00:15 Irving314 阅读(6772) 评论(1) 推荐(0) 编辑
摘要: 我们在使用messagebox时,通常采用下面的最简化的方式:MessageBox.Show("Hello World!");当我们为messagebox添加标题时,可以这样做:MessageBox.Show("Hello World!", "A Message");也可以使用System.Windows.Forms.MessageBoxButtons enumeration为messagebox添加按钮。MessageBox.Show("Hello World!", "A Message", 阅读全文
posted @ 2011-06-24 17:30 Irving314 阅读(787) 评论(2) 推荐(0) 编辑
摘要: Control.Anchor 属性 :获取或设置控件绑定到的容器的边缘并确定控件如何随其父级一起调整大小。AnchorStyles 值的按位组合。默认值是 Top 和 Left。使用 Anchor 属性可以定义在调整控件的父控件大小时如何自动调整控件的大小。将控件锚定到其父控件后,可确保当调整父控件的大小时锚定的边缘与父控件的边缘的相对位置保持不变。一个控件可以锚定到其容器的一个或多个边缘。例如,如果有一个带有 Button 的 Form,而该按钮的 Anchor 属性值设置为 Top 和 Bottom,当 Form 的 Height 增加时,Button 伸展,以保持到 Form 的上边缘和 阅读全文
posted @ 2011-06-23 22:16 Irving314 阅读(6951) 评论(0) 推荐(0) 编辑
摘要: FormBorderStyle :指示窗体的边框和和标题栏的外观和行为。1.None-->无边框;2.FixedSingle-->固定的单行边框;3.Fixed3D-->固定的三维边框;4.FixedDialog-->固定的对话框样式的粗边框;5.Sizable-->可调整大小的边框;6.FixedToolWindow-->不可调整大小的工具窗口边框。工具窗口不会显示在任务栏中也不会显示在当用户按 Alt+Tab 时出现的窗口中。尽管指定 FixedToolWindow 的窗体通常不显示在任务栏中,还是必须确保 ShowInTaskbar 属性设置为 fal 阅读全文
posted @ 2011-06-23 21:45 Irving314 阅读(3358) 评论(0) 推荐(0) 编辑