Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - INT 1
Search - INT 1 - List
using System using System.Runtime.InteropServices namespace JustinIO { ?class CommPort { ??public string PortNum ??public int BaudRate ??public byte ByteSize ??public byte Parity // 0-4=no,odd,even,mark,space ??public byte StopBits // 0,1,2 = 1, 1.5, 2 ??public int ReadTimeout ?? ??//comm port win32 file handle ??private int hComm = -1 ?? ??public bool Opened = false ?? ??//win32 api constants ??? private const uint GENERIC_READ = 0x80000000 ??? private const uint GENERIC_WRITE = 0x40000000 ??? private const int OPEN_EXISTING = 3 ?? ??? private const int INVALID_HANDLE_VALUE = -1 -using System using System.Runtime.InteropServices Namespace JustinIO {? Class CommPort { ? ? Public string PortNum? ? Public int BaudRate? ? Public byte ByteSize? ? Public byte Parity // 0-4=no, odd, even, mark, space? ? Public byte StopBits // 0,,1,2 = 1, 1.5, 2? ? Public int ReadTimeout? ? ? ? //comm port win32 file handle? ? Private int hComm = -1? ? ? ? Public bool Opened = false? ? ? ? //win32 api constants? ? ? Private const uint GENERIC_READ = 0x80000000? ? ? Private const uint GENERIC_WRITE = 0x40000000? ? ? Private const int OPEN_EXISTING = 3? ? ? ? ? Private const int INVALID_HANDLE_VALUE = -1? ?
Date : 2008-10-13 Size : 8.93kb User : liucheng

2个主机互相发送和接收数据,用DatagramSocket类另一个构造方法DatagramSocket(int port)创建一个对象。
Date : 2008-10-13 Size : 2.37kb User : 朱振强

VC++ 封装了队列类 /// /// /// ///// //this a example for using Queue ///////////////////////////////////////// #include \"Queue.h\" //define queue data struct struct QueueData { char data[20] int nId } //define queue typedef TQueue<QueueData> TMyQueue //put data into queue { QueueData data memset(&data, 0, sizeof(data)) strcpy(data.data, \"hello!\") data.nId = 0 m_pMyQueue.TryPut(data) } //try put data into queue { QueueData data memset(&data, 0, sizeof(data)) strcpy(data.data, \"hello!\") data.nId = 0 if(m_pMyQueue.TryPut(data) != 0) { MessageBox(\"put queue error\") } else { MessageBox(\"put queue success\") } } //get data from queue { QueueData data memset(&data, 0, sizeof(data)) m_pMyQueue.Get(data) MessageBox(data.data) } //try get data from queue { QueueData data memset(&data, 0, sizeof(data)) m_pMyQueue.TryGet(data) MessageBox(data.data) }-cohort of VC Packaging category ///////////////////////////////////////// / / this is a example for using Queue ///////////////////////////////////////// # include "Queue . h "/ / define queue data struct QueueData struct (char data [20] int nId) / / define queue typedef TQueuelt; QueueDatagt; TMyQueue / / put data into QueueData data queue (memset (data, 0, sizeof (data)) htpasswd (data.data, "hello!") data.nId m_pMyQueue.TryPut = 0 (data)) / / try put data into QueueData data queue (memset (data, 0, sizeof (data)) htpasswd (data. data, "hello!") data.nId = 0 if (m_pMyQueue.TryPut (data)! = 0) (MessageBox ( "put queue error")) else (MessageBox ( "put queue success"))) / / get data from QueueData data queue (memset (data, 0, sizeof (data))
Date : 2008-10-13 Size : 33.71kb User : zj

VC++ 封装了队列类 /// /// /// ///// //this a example for using Queue ///////////////////////////////////////// #include "Queue.h" //define queue data struct struct QueueData { char data[20] int nId } //define queue typedef TQueue<QueueData> TMyQueue //put data into queue { QueueData data memset(&data, 0, sizeof(data)) strcpy(data.data, "hello!") data.nId = 0 m_pMyQueue.TryPut(data) } //try put data into queue { QueueData data memset(&data, 0, sizeof(data)) strcpy(data.data, "hello!") data.nId = 0 if(m_pMyQueue.TryPut(data) != 0) { MessageBox("put queue error") } else { MessageBox("put queue success") } } //get data from queue { QueueData data memset(&data, 0, sizeof(data)) m_pMyQueue.Get(data) MessageBox(data.data) } //try get data from queue { QueueData data memset(&data, 0, sizeof(data)) m_pMyQueue.TryGet(data) MessageBox(data.data) }-cohort of VC Packaging category /////////////////////////////////////////// this is a example for using Queue /////////////////////////////////////////# include "Queue . h "//define queue data struct QueueData struct (char data [20] int nId)// define queue typedef TQueuelt; QueueDatagt; TMyQueue// put data into QueueData data queue (memset (data, 0, sizeof (data)) htpasswd (data.data, "hello!") data.nId m_pMyQueue.TryPut = 0 (data))// try put data into QueueData data queue (memset (data, 0, sizeof (data)) htpasswd (data. data, "hello!") data.nId = 0 if (m_pMyQueue.TryPut (data)! = 0) (MessageBox ( "put queue error")) else (MessageBox ( "put queue success")))// get data from QueueData data queue (memset (data, 0, sizeof (data))
Date : 2026-01-07 Size : 33kb User : zj

using System using System.Runtime.InteropServices namespace JustinIO { ?class CommPort { ??public string PortNum ??public int BaudRate ??public byte ByteSize ??public byte Parity // 0-4=no,odd,even,mark,space ??public byte StopBits // 0,1,2 = 1, 1.5, 2 ??public int ReadTimeout ?? ??//comm port win32 file handle ??private int hComm = -1 ?? ??public bool Opened = false ?? ??//win32 api constants ??? private const uint GENERIC_READ = 0x80000000 ??? private const uint GENERIC_WRITE = 0x40000000 ??? private const int OPEN_EXISTING = 3 ?? ??? private const int INVALID_HANDLE_VALUE = -1 -using System using System.Runtime.InteropServices Namespace JustinIO {? Class CommPort { ? ? Public string PortNum? ? Public int BaudRate? ? Public byte ByteSize? ? Public byte Parity // 0-4=no, odd, even, mark, space? ? Public byte StopBits // 0,,1,2 = 1, 1.5, 2? ? Public int ReadTimeout? ? ? ? //comm port win32 file handle? ? Private int hComm =-1? ? ? ? Public bool Opened = false? ? ? ? //win32 api constants? ? ? Private const uint GENERIC_READ = 0x80000000? ? ? Private const uint GENERIC_WRITE = 0x40000000? ? ? Private const int OPEN_EXISTING = 3? ? ? ? ? Private const int INVALID_HANDLE_VALUE =-1? ?
Date : 2026-01-07 Size : 9kb User : liucheng

2个主机互相发送和接收数据,用DatagramSocket类另一个构造方法DatagramSocket(int port)创建一个对象。-2 host each other to send and receive data, use another constructor DatagramSocket Class DatagramSocket (int port) to create an object.
Date : 2026-01-07 Size : 2kb User : 朱振强

TC下的串口通讯.c 主程序部分 #include "uart.h" int iBase /* com port base address */ char cHI,cLO void compute_chksum(char cBuf[]) char hex_to_ascii(int iHex) -TC under the serial communication. C main part# Include uart.h int iBase/* com port base address*/char cHI, cLO void compute_chksum (char cBuf []) char hex_to_ascii (int iHex)
Date : 2026-01-07 Size : 4kb User : bound

DL : 0
DW 256 DUP(?) STACK1 ENDS DDATA SEGMENT MES1 DB The least number is:$ MES2 DB 0AH,0DH, The largest number is:$ NUMB DB 0D9H,07H,8BH,0C5H,0EBH,04H,9DH,0F9H DDATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DDATA START: MOV AX,DDATA MOV DS,AX MOV SI,OFFSET NUMB MOV CX,0008H JCXZ A4 MOV BH,[SI] MOV BL,BH A1: LODSB AL=DS:[SI],SI=SI+1 CMP AL,BH JBE A2 MOV BH,AL JMP A3 A2: CMP AL,BL JAE A3 MOV BL,AL A3: LOOP A1 A4: MOV DX,OFFSET MES1 show mes1 MOV AH,09H INT 21H MOV AL,BL show the least number AND AL,0F0H get the highest 4 bits SHR AL,4 CMP AL,0AH JB C2 ADD AL,07H C2: ADD AL,30H MOV DL,AL show character MOV AH,02H INT 21H MOV AL,BL AND AL,0FH get the lowest 4 bits CMP AL,0AH JB C3 ADD AL,07H C3: ADD AL,30H MOV DL,AL show character MOV AH,02H INT 21H MOV DX,OFFSET MES2 show mes2 MOV AH,09H INT 21H -DW 256 DUP (?) STACK1 ENDSDDATA SEGMENTMES1 DB The least number is: $ MES2 DB 0AH, 0DH, The largest number is: $ NUMB DB 0D9H, 07H, 8BH, 0C5H, 0EBH, 04H, 9DH, 0F9HDDATA ENDSCODE SEGMENT ASSUME CS: CODE, DS: DDATASTART: MOV AX, DDATA MOV DS, AX MOV SI, OFFSET NUMB MOV CX, 0008H JCXZ A4 MOV BH, [SI] MOV BL, BHA1: LODSB AL = DS: [SI], SI = SI+ 1 CMP AL, BH JBE A2 MOV BH, AL JMP A3A2: CMP AL, BL JAE A3 MOV BL, ALA3: LOOP A1A4: MOV DX, OFFSET MES1 show mes1 MOV AH, 09H INT 21H MOV AL, BL show the least number AND AL , 0F0H get the highest 4 bits SHR AL, 4 CMP AL, 0AH JB C2 ADD AL, 07H C2: ADD AL, 30H MOV DL, AL show character MOV AH, 02H INT 21H MOV AL, BL AND AL, 0FH get the lowest 4 bits CMP AL, 0AH JB C3 ADD AL, 07HC3: ADD AL, 30H MOV DL, AL show character MOV AH, 02H INT 21H MOV DX, OFFSET MES2 show mes2 MOV AH, 09H INT 21H
Date : 2026-01-07 Size : 1kb User : 张于

一个很全很不错的labview 串口编程源代码-labview mscomm source code
Date : 2026-01-07 Size : 17kb User : lili

DL : 0
led取模软件自己用VC写的液晶等字模提取软件,可以输入汉字,也可以打开BMP图。只需要修改少许代码就可以按自己的要求实现功能。-You can get the zimo ,to display int the led displayer,and it use the vc++
Date : 2026-01-07 Size : 172kb User : 赵英伟

1、首先需要定义的对象: SOCKET ReceivingSocket //接收端的Socket SOCKADDR_IN ReceiverAddr //接收端的地址信息 char ReceiveBuf[1024] //接收数据缓冲区大小 int BufLength //缓冲区长度 SOCKADDR_IN SenderAddr //发送数据端地址信息 int SenderAddrSize = sizeof(SenderAddr) //发送端地址信息的长度 2、启动WSA动态库: WSAStartup(MAKEWORD(2,2),&wsd) 3、创建socket: ReceivingSocket=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP) 4、初始化服务器地址及监听端口 ReceiverAddr.sin_family=AF_INET //家族 ReceiverAddr.sin_port=htons(9000) //设置端口号 ReceiverAddr.sin_addr.s_addr=htonl(INADDR_ANY) //地址 5、绑定端口 6、接收数据: ReceivingSocket,//接收端Socket ReceiveBuf,//接收端用来存储数据的缓冲区 BufLength,//缓冲区的大小 0,//接收的附加选项,设置为0即可 (SOCKADDR*)&SenderAddr,//发送端的Socket地址 &SenderAddrSize//发送端Socket地址的大小 ) 7、关闭socket,关闭WSA,1, you first need to define the object: the SOCKET ReceivingSocket // the the receiving end Socket SOCKADDR_IN distant ReceiverAddr // the receiving end the address information char ReceiveBuf of [1024] /​ ​ / receive data buffer size int BufLength // buffer length SOCKADDR_IN distant SenderAddr // send data end address information int SenderAddrSize = sizeof (SenderAddr) // length of the address information of the sender, start WSA dynamic library: the WSAStartup (MAKEWORD (2,2), & wsd) 3, create socket: ReceivingSocket = socket ( AF_INET, SOCK_DGRAM, IPPROTO_UDP) initialize server address and listen port ReceiverAddr.sin_family = AF_INET //family ReceiverAddr.sin_port = htons (9000) //set port number ReceiverAddr.sin_addr.s_addr = htonl (INADDR_ANY) //address 5, binding port 6 the the receiver Data: ReceivingSocket,// ​ ​ receiving end the the Socket ReceiveBuf,// ​ ​ receiving end is used to store data buffer BufLength// buffer size 0,// ​
Date : 2026-01-07 Size : 4.98mb User : xiaoxiao

pcomm.lib串口编程库。PComm 库函数是台湾MOXA公司提供的,他为用户提供了基于win32 api的开发接口。 PComm库函数分为7大类:控制函数、数据输入函数、数据输出函数、状态函数、事件驱动函数、传输文件函数、特殊设定函数;上述函数均返回int型数据,若函数调用成功则返回0,否则返回一个负整数。-pcomm.lib serial programming library. PComm library functions Taiwan MOXA company, to provide users with the interface based on the Win32 API development. PComm library functions are divided into 7 categories: control function, data input function, a function of the data output state function, event-driven function, transfer files, functions, special setting function the function returns an int data if the function succeeds it returns 0, otherwise it returns a negative integer.
Date : 2026-01-07 Size : 33kb User : 陈江明

对于32位字长的机器,大约超过20亿,用int类型就无法表示了,我们可以选择int64类型,但无论怎样扩展-Over 2 billion for the 32-bit word length machines, about int type can not be expressed, we can choose the int64 type, but no matter how extended
Date : 2026-01-07 Size : 1kb User : xia187215

二叉树的递归算法:计算高度、结点个数、交换左右儿子问题的描述写一完整函数,计算树的结点数目int CountNode(BTNode< T> * &t);完善以下两个函数:计算树的高度int Depth(BTNode< T> * &root);对树的所有子树交换左右孩子void swapsons(BTNode< T> * &t);-Binary Tree Recursive Algorithm: Calculate the height of node number, the exchange about the issue of his son to write a complete description of function, calculating the number of tree node int CountNode (BTNode
Date : 2026-01-07 Size : 2kb User : zhong078352

输入:假设 a,b,c均int。输出:要求输出的根为 double 型,保留 6 位小数。-Input: Suppose a, b, and c an int. Output: root for output to a double, retaining six decimal places.
Date : 2026-01-07 Size : 3kb User : jie8406284

ip从char[]转为int,ip地址转换- transform ip char[] to int
Date : 2026-01-07 Size : 1kb User : lao615793

自己用的小软件,仿造原子的XCOM功能,加了一下自己用的功能。 1、基本串口通讯,鼠标放入串口选择自动刷新,显示COM口的驱动类型。 2、多条发送界面,可定时发送,可关联数字键盘、右键发送按钮可更改按钮名称,方便记忆。 3、485通讯,数据有十进制和十六进制可选,发送后自动保留记录。 4、CRC校验小工具。 5、十六进制通信协议提取部分位并根据自定义数据类型转化为十进制 6、字符格式示波器,例:">P:-1.25",示波器显示曲线名称P,数值-1.25,曲线个数最多8个。 7、类似MODBUS协议截取第2-5位,合成一个int数值,然后示波器显示波形,最多5个曲线 8、示波器曲线可键拖拽、放大(QT serial port assistant, plus digital oscilloscope)
Date : 2026-01-07 Size : 331kb User : 物极必反1024
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.