另外,句柄hComm,在关闭后,我没delete,而是hComm=0;这样可以么?
解决方案 »
- 没高手,每次都散分,再问一个,给20分,不是高手的来接分吧
- 透明处理加色,困扰很久
- 【转:强贴】49年后称帝者一览(正史)有档案记录
- p2p中问题?NAT把数据报丢弃的问题(在线等)
- 【重大发现】
- 大侠,我的语句有什么错?CArray<CPoint,CPoint> m_pointArray;在线结帐!!!
- 请问哪里有<<Windows程序设计>>这本书的电子版下载??
- opengl怪现象求助
- 妹子求MFC大神帮忙画个曲线
- 在NT4.0 server中,能否用ASP调用自己写的COM(或COM+)程序?
- ****CAsyncSocket派生类在线程中关闭出错****
- 为什么我编译后的"Hello world"可执行程序这么大?竟然有221KB?这正常吗?
OPEN_EXISTING,0, NULL);
DCB dcb;
GetCommState(hComm[i],&dcb);
dcb.BaudRate=CBR_9600;
dcb.Parity=EVENPARITY;
dcb.ByteSize=8;
dcb.StopBits=TWOSTOPBITS;
SetCommState(hComm[i],&dcb);
SetupComm(hComm[i],1024,1024);
^这是啥子意思?VC中的例子:DCB dcb;
HANDLE hCom;
DWORD dwError;
BOOL fSuccess;hCom = CreateFile( "COM1",
GENERIC_READ | GENERIC_WRITE,
0, // comm devices must be opened w/exclusive-access
NULL, // no security attributes
OPEN_EXISTING, // comm devices must use OPEN_EXISTING
0, // not overlapped I/O
NULL // hTemplate must be NULL for comm devices
);if (hCom == INVALID_HANDLE_VALUE)
{
dwError = GetLastError(); // handle error
}// Omit the call to SetupComm to use the default queue sizes.
// Get the current configuration.fSuccess = GetCommState(hCom, &dcb);if (!fSuccess)
{
// Handle the error.
}// Fill in the DCB: baud=9600, 8 data bits, no parity, 1 stop bit. dcb.BaudRate = 9600;
dcb.ByteSize = 8;
dcb.Parity = NOPARITY;
dcb.StopBits = ONESTOPBIT;fSuccess = SetCommState(hCom, &dcb);if (!fSuccess)
{
// Handle the error.
}