Click here to Skip to main content
15,905,686 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: undelete Pin
John M. Drescher17-Aug-03 19:00
John M. Drescher17-Aug-03 19:00 
GeneralRe: undelete Pin
parths18-Aug-03 17:59
parths18-Aug-03 17:59 
GeneralRe: undelete Pin
John M. Drescher18-Aug-03 18:13
John M. Drescher18-Aug-03 18:13 
GeneralMFC FAQ Pin
Joey Bloggs17-Aug-03 17:45
Joey Bloggs17-Aug-03 17:45 
GeneralRe: MFC FAQ Pin
HPSI17-Aug-03 20:35
HPSI17-Aug-03 20:35 
GeneralRe: MFC FAQ Pin
Rohde17-Aug-03 22:43
Rohde17-Aug-03 22:43 
GeneralRe: MFC FAQ Pin
HPSI18-Aug-03 2:21
HPSI18-Aug-03 2:21 
QuestionHow I can call SetCommState successfully? Pin
Cyclist17-Aug-03 17:42
Cyclist17-Aug-03 17:42 
I am writing a class for serial port communication.
It always returns FALSE when I set commport state by calling
win32 api SetCommState.
following is some code from my class:
//code starts here
//m_hComm is an effective handle to commport
m_dcb.DCBlength= sizeof(DCB);
m_dcb.BaudRate =nBaud;
m_dcb.ByteSize = nDataBits;
m_dcb.Parity =nParity ;
m_dcb.StopBits =nStopBits;
m_dcb.fBinary=TRUE;
m_dcb.fDsrSensitivity=FALSE;
m_dcb.fParity=bParity;
m_dcb.fOutX=FALSE;
m_dcb.fInX=FALSE;
m_dcb.fNull=FALSE;
m_dcb.fAbortOnError=TRUE;
m_dcb.fOutxCtsFlow=FALSE;
m_dcb.fOutxDsrFlow=FALSE;
m_dcb.fDtrControl=DTR_CONTROL_DISABLE;
m_dcb.fDsrSensitivity=FALSE;
m_dcb.fRtsControl=RTS_CONTROL_DISABLE;
m_dcb.fOutxCtsFlow=FALSE;
m_dcb.fOutxCtsFlow=FALSE;

BOOL bRet= ::SetCommState(m_hComm, &m_dcb);
if(!bRet)
{
CloseHandle(m_hComm);
MessageBox(NULL, "Set comm state error!", NULL, MB_OK);
return FALSE;
}
//code ends here
The bRet of above is always FALSE.How I can call SetCommState Successfully?D'Oh! | :doh:
I need your help. Thanks.
AnswerRe: How I can call SetCommState successfully? Pin
Fredrik Skog18-Aug-03 0:44
Fredrik Skog18-Aug-03 0:44 
GeneralDeserialeze speed slow when file is big Pin
jim wang17-Aug-03 17:06
jim wang17-Aug-03 17:06 
GeneralRe: Deserialeze speed slow when file is big Pin
Neville Franks18-Aug-03 0:36
Neville Franks18-Aug-03 0:36 
GeneralAfxBeginThread and static functions Pin
Mike Ellertson17-Aug-03 16:37
sussMike Ellertson17-Aug-03 16:37 
GeneralRe: AfxBeginThread and static functions Pin
John M. Drescher17-Aug-03 16:56
John M. Drescher17-Aug-03 16:56 
GeneralRe: AfxBeginThread and static functions Pin
jhwurmbach17-Aug-03 23:48
jhwurmbach17-Aug-03 23:48 
GeneralChild window can't get focus Pin
TianYang17-Aug-03 15:20
TianYang17-Aug-03 15:20 
GeneralRe: Child window can't get focus Pin
Iain Clarke, Warrior Programmer18-Aug-03 1:12
Iain Clarke, Warrior Programmer18-Aug-03 1:12 
GeneralRe: Child window can't get focus Pin
TianYang18-Aug-03 16:51
TianYang18-Aug-03 16:51 
GeneralData from Printer/Serial Port Pin
Hosam Aly Mahmoud17-Aug-03 12:50
Hosam Aly Mahmoud17-Aug-03 12:50 
GeneralCWinThread and starting a thread from a class function Pin
Kuniva17-Aug-03 9:56
Kuniva17-Aug-03 9:56 
GeneralRe: CWinThread and starting a thread from a class function Pin
Ryan Binns17-Aug-03 15:30
Ryan Binns17-Aug-03 15:30 
GeneralRe: CWinThread and starting a thread from a class function Pin
Mike Ellertson17-Aug-03 16:39
sussMike Ellertson17-Aug-03 16:39 
GeneralRe: CWinThread and starting a thread from a class function Pin
Ryan Binns17-Aug-03 16:56
Ryan Binns17-Aug-03 16:56 
GeneralRe: CWinThread and starting a thread from a class function Pin
Kuniva18-Aug-03 1:00
Kuniva18-Aug-03 1:00 
GeneralRe: CWinThread and starting a thread from a class function Pin
Ryan Binns18-Aug-03 4:13
Ryan Binns18-Aug-03 4:13 
QuestionWhats the difference? Pin
leppie17-Aug-03 9:13
leppie17-Aug-03 9:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.