COM port read error 995 ReadFile (Windows)
Paul whoknows

I am reading the COM port using ReadFile in non-overlapped mode, it works sometimes, but sometimes it does not work and I get this error 995 "ERROR_OPERATION_ABORTED".
I don't really have idea why this works and then it doesn't, it works randomly.
Did anyone here passed through the pain of trying to read the COM port successfully in Windows?

bamccaig

uggc://jjj.rkcregf-rkpunatr.pbz/Cebtenzzvat/Ynathntrf/PCC/D_20035151.ugzy

I encoded it because I didn't want to have that site appear on Allegro.cc (at least it will require a little more work now). :P It was the only good resource that I was able to find though. The solutions should be at the bottom or in the page source (no subscription required). It seems to have the answer. Maybe.

Paul whoknows

Thanks bamccaig! I think it was a problem of buffer length, I just reduced the number of bytes sent from 200 to only a few and now it works fine, not sure about what caused the error, but don't want to mess with Microsoft's MSDN again, I think I'll never like it.

GullRaDriel

That link sucks. Expert Exchange is mostly costing money and occasionaly have some answer in the comments.

bamccaig

Yeah, I hate it too, but often (especially when searching for non-.NET/Windows stuff) it's the only semi-on-topic Google results... Occasionally they have the solution to your problem. I would never subscribe though. :P

** EDIT **

I now realize that the link isn't working properly... I hate Experts Exchange... You can find the link again through Google: 995 read serial port. At the time of writing, it was the 11th result for me (top of second default page). For some reason, when coming from Google the solutions are displayed, at least for me... :-/ I only bother checking Experts Exchange links when I'm desperate. :P

GullRaDriel
bamcaig said:

I only even bother checking Experts Exchange links when I'm desperate. :P

;-)

Thread #597634. Printed from Allegro.cc