Click here to Skip to main content
15,921,793 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Displaying Symbol issue......... Pin
toxcct26-Jan-09 4:09
toxcct26-Jan-09 4:09 
GeneralRe: Displaying Symbol issue......... Pin
CPallini26-Jan-09 6:43
mveCPallini26-Jan-09 6:43 
GeneralRe: Displaying Symbol issue......... Pin
Eytukan26-Jan-09 18:52
Eytukan26-Jan-09 18:52 
GeneralRe: Displaying Symbol issue......... Pin
CPallini27-Jan-09 0:47
mveCPallini27-Jan-09 0:47 
JokeRe: Displaying Symbol issue......... Pin
toxcct30-Jan-09 1:54
toxcct30-Jan-09 1:54 
GeneralRe: Displaying Symbol issue......... Pin
Eytukan30-Jan-09 6:55
Eytukan30-Jan-09 6:55 
GeneralRe: Displaying Symbol issue......... Pin
Cedric Moonen26-Jan-09 3:37
Cedric Moonen26-Jan-09 3:37 
GeneralRe: Displaying Symbol issue......... Pin
CPallini26-Jan-09 3:51
mveCPallini26-Jan-09 3:51 
GeneralRe: Displaying Symbol issue......... Pin
Rajesh R Subramanian26-Jan-09 4:08
professionalRajesh R Subramanian26-Jan-09 4:08 
GeneralRe: Displaying Symbol issue......... Pin
toxcct26-Jan-09 4:16
toxcct26-Jan-09 4:16 
GeneralRe: Displaying Symbol issue......... Pin
Rajesh R Subramanian26-Jan-09 4:03
professionalRajesh R Subramanian26-Jan-09 4:03 
GeneralRe: Displaying Symbol issue......... Pin
toxcct26-Jan-09 4:08
toxcct26-Jan-09 4:08 
GeneralRe: Displaying Symbol issue......... Pin
Rajesh R Subramanian26-Jan-09 4:15
professionalRajesh R Subramanian26-Jan-09 4:15 
GeneralRe: Displaying Symbol issue......... Pin
toxcct26-Jan-09 4:20
toxcct26-Jan-09 4:20 
JokeRe: Displaying Symbol issue......... Pin
CPallini26-Jan-09 6:48
mveCPallini26-Jan-09 6:48 
QuestionWorking with DB Pin
CodingLover25-Jan-09 18:33
CodingLover25-Jan-09 18:33 
QuestionRe: Working with DB Pin
David Crow26-Jan-09 2:56
David Crow26-Jan-09 2:56 
AnswerRe: Working with DB Pin
Jose David Pujo26-Jan-09 4:38
Jose David Pujo26-Jan-09 4:38 
QuestionAfxGetInstanceHandle Crash in MFC Extension dlls Pin
Neptunex25-Jan-09 17:55
Neptunex25-Jan-09 17:55 
AnswerRe: AfxGetInstanceHandle Crash in MFC Extension dlls Pin
Randor 25-Jan-09 18:23
professional Randor 25-Jan-09 18:23 
AnswerRe: AfxGetInstanceHandle Crash in MFC Extension dlls Pin
Neptunex26-Jan-09 0:53
Neptunex26-Jan-09 0:53 
GeneralRe: AfxGetInstanceHandle Crash in MFC Extension dlls Pin
Randor 26-Jan-09 9:21
professional Randor 26-Jan-09 9:21 
GeneralRe: AfxGetInstanceHandle Crash in MFC Extension dlls Pin
Neptunex3-Mar-09 20:27
Neptunex3-Mar-09 20:27 
QuestionCommunication app. using dial-up modem times out Pin
Member 171596825-Jan-09 17:51
Member 171596825-Jan-09 17:51 
AnswerRe: Communication app. using dial-up modem times out Pin
Jonathan Davies25-Jan-09 23:51
Jonathan Davies25-Jan-09 23:51 
I've never used a modem, just a port for serial comms but have seen similar problems.
First I'd recommend if you are not using PortMon or a similar utility to do so to see exectly whats happening at a lower level.
Obviously you could extend the timeout but whilst 2mS might work, there's still (presumably) nothing in your code to handle what to do if it doesn't.
Why read a byte at a time? OK it works, but you could attempt to read the number of bytes expected in the whole expected message and then check the number of bytes read? You could then get, say 28 bytes when you expect 30, buffer them read again and add the first 2 bytes of the second read to the end of the buffer etc.
When using ports I work on the assumption that you may not get what you expect:
while(!bFullMessageReceived)
{
    //// Might read anything: nothing, part of a message or perhaps the end of one message and the beginning of another
    BOOL bRead = ::ReadFile(m_portHandle, static_cast<LPVOID>(ReadBuff), dwMaxBytesToRead,&dwBytesRead,NULL);
    if(FALSE == bRead)
    {
        ...

I would recommend treating a timeout as something that is a valid event, which it is. It's not an error: it happens and it not in your control, so you have to deal with it.

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.