Click here to Skip to main content
16,008,183 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralVARIANT Pin
Roger H Art26-May-04 6:59
sussRoger H Art26-May-04 6:59 
GeneralRe: VARIANT Pin
mezla26-May-04 21:42
mezla26-May-04 21:42 
GeneralVARIANT Pin
Anonymous26-May-04 6:58
Anonymous26-May-04 6:58 
GeneralWindows media player Pin
Trollslayer26-May-04 6:56
mentorTrollslayer26-May-04 6:56 
GeneralRe: Windows media player Pin
Michael Dunn26-May-04 8:32
sitebuilderMichael Dunn26-May-04 8:32 
GeneralRe: Windows media player Pin
Trollslayer26-May-04 9:45
mentorTrollslayer26-May-04 9:45 
GeneralDate/Time Picker in CListCtrl Pin
aswdwdwd26-May-04 6:40
aswdwdwd26-May-04 6:40 
GeneralCSerialPort Class Problem and Error 87 Pin
AnotherProgrammer26-May-04 6:25
AnotherProgrammer26-May-04 6:25 
Hello.

First, I'd like you to take a look at this post from another forum: http://www.codeguru.com/forum/showthread.php?s=4f35cbebe00b8299d7c4f45da97051c1&threadid=193904 (it explains the problem with CSerialPort -- this should also be brought to the attention of the authors of the class)

Anyway, I came across the exact same problem, except I was not using the class. I simply had WaitCommEvent and GetLastError() give me the same error 87 using this piece of code:
if (WaitCommEvent(hCom, &event, &obj))
{
    cout << "Character Detected! ";
    fsuccess = ReadFile (hCom, &data, 1, &transferred, &obj);
    if (fsuccess)
 	cout << "Character Read! Here it is: " << data;
    getch();
}
else
{
    if (GetLastError() == ERROR_IO_PENDING)
       	cout << "Still waiting";
    else
    {
       	cout << "Fatal error: " << GetLastError();
        getch();
        exit(1);
    }
}


As I said, the output for this program is Fatal error: 87. I should explain, this is after the COM1 port has been opened successfully for reading. Does anyone have any suggestions as to how to solve this? I will be very thankful if someone could help.

Thanks..
GeneralPS - sorry, here's the link to that other post... Pin
AnotherProgrammer26-May-04 6:29
AnotherProgrammer26-May-04 6:29 
GeneralNetwork Order cponversion Pin
Stan the man26-May-04 6:17
Stan the man26-May-04 6:17 
GeneralRe: Network Order cponversion Pin
Ryan Binns26-May-04 19:05
Ryan Binns26-May-04 19:05 
GeneralGrabbing standard out to a pipe Pin
Anonymous26-May-04 5:57
Anonymous26-May-04 5:57 
GeneralRe: Grabbing standard out to a pipe Pin
Antti Keskinen26-May-04 11:46
Antti Keskinen26-May-04 11:46 
Generalwaiting for something to finished Pin
pnpfriend26-May-04 5:47
pnpfriend26-May-04 5:47 
GeneralRe: waiting for something to finished Pin
valikac26-May-04 13:22
valikac26-May-04 13:22 
GeneralRe: waiting for something to finished Pin
pnpfriend27-May-04 8:50
pnpfriend27-May-04 8:50 
GeneralListView: XP - 2000 CPU usage Pin
Dan Hill26-May-04 5:35
Dan Hill26-May-04 5:35 
GeneralRe: ListView: XP - 2000 CPU usage Pin
Ryan Binns26-May-04 19:08
Ryan Binns26-May-04 19:08 
GeneralOCCMGR.CPP Assertion Error Line 410 Pin
sweep12326-May-04 5:13
sweep12326-May-04 5:13 
GeneralRe: OCCMGR.CPP Assertion Error Line 410 Pin
jmkhael26-May-04 5:28
jmkhael26-May-04 5:28 
GeneralRe: OCCMGR.CPP Assertion Error Line 410 Pin
sweep12326-May-04 5:40
sweep12326-May-04 5:40 
GeneralRe: OCCMGR.CPP Assertion Error Line 410 Pin
jmkhael26-May-04 5:42
jmkhael26-May-04 5:42 
GeneralRe: OCCMGR.CPP Assertion Error Line 410 Pin
sweep12326-May-04 5:48
sweep12326-May-04 5:48 
GeneralRe: OCCMGR.CPP Assertion Error Line 410 Pin
jmkhael26-May-04 5:57
jmkhael26-May-04 5:57 
GeneralRe: OCCMGR.CPP Assertion Error Line 410 Pin
sweep12326-May-04 6:09
sweep12326-May-04 6:09 

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.