当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: 既然有这么多人问这个文体,贝贝就给个Visual C++ 4.2写的 Window 95串口通讯函数集合(只适用于32位) 需要说明的是:这是我程序的一部分,因此有一些与具体应用无关的部分。
 

 

 ·vc下设置excel单元格的边框    »显示摘要«
    摘要:为了能使得输出到excel中的数据显示表格,可以调用事先设置好的模板,但是不灵活。我花了一个中午的时间摸索出如何设置它了。 具体代码如下: lpdispatch prange; cstring cell; int c,c1,c2; _variant_t vrange1; // 设置单元格的线; _variant_t vrange2; _variant_t vrange3; _varia......
 ·pyos 支持的 fat12 文件系统~~~~    »显示摘要«
    摘要: pyos 支持的 fat12 文件系统 这两天写了一个 pyos 使用的 fat12 文件系统驱动, 同前一个版本一样, 原生的 gui 图形界面, 它有如下一些特点: 增加了一个启动界面:screen.width-500)this.style.width=screen.width-500;" border=0>此主题相关图片如下:screen.width-500)this.sty......


VC在windows下编写用于串行通讯的程序
既然有这么多人问这个文体,贝贝就给个visual c++ 4.2写的

window 95串口通讯函数集合(只适用于32位) 【程序编程相关:MFC 远近之论!

【推荐阅读:关于__initcall_start的研

【扩展信息:LINUX KERNEL 配置编译中文指

需要说明的是:这是我程序的一部分,因此有一些与具体应用无关的部分.

但我觉得关键是原理,而不是程序本身.后面有些使用介绍,帮助理解这长的程序.

头文件(.h)

#include "stdafx.h"

#define gwl_pgpsinfo 0

#define gpsextrabytes sizeof( long )

#define maxports 4

#define cn_send wm_user+100

#define rxqueue 4096

#define txqueue 4096

// cursor states

#define cs_hide 0x00

#define cs_show 0x01

// flow control flags

#define fc_dtrdsr 0x01

#define fc_rtscts 0x02

#define fc_xonxoff 0x04

// ascii definitions

#define ascii_bel 0x07

#define ascii_bs 0x08

#define ascii_lf 0x0a

#define ascii_cr 0x0d

#define ascii_xon 0x11

#define ascii_xoff 0x13

// data structures

typedef struct taggpsinfo

{

handle idcomdev;

byte bport;

bool fconnected;

byte bbytesize,bparity,bstopbits;

dword dwbaudrate;

handle hpostevent,hwatchthread,hwatchevent;

hwnd htermwnd;

dword dwthreadid;

overlapped oswrite,osread;

} gpsinfo, *pgpsinfo ;

#define comdev( x ) (x -> idcomdev)

#define port( x ) (x -> bport)

#define connected( x ) (x -> fconnected)

#define bytesize( x ) (x -> bbytesize)

#define parity( x ) (x -> bparity)


...   下一页
 ·vc实现对话框上信息的显示    »显示摘要«
    摘要:利用 vc的appwizard,可以很容易地实现工具条和菜单项的tooltip,或在状态条上显示帮助信息,但要在对话框的控件上显示tooltip和在状态条上显示控件信息并不容易实现。现在,我们用vc中的wm_setcursor 与ttn_needtext消息就可达到目的。具体操作如下:    一、利用 vc的 mfc appwizard 生成一个 sdi 或 mdi 的应用程序    二、......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE