I wrote a program that communicates using the serial port using MFC. For some reason, sometimes it works fine, but other times, it doesn't. Oddly enough, for those times that it doesn't connect, if I open a connection using hyperterminal, then close it, then try again with my program, then it works fine. Does anyone have a clue what I'm doing wrong?
Not without you posting a MINIMAL yet complete piece of code. Once you strip out every line that has nothing to do with the problem, and have a small single file program that reproduces the error, post it here (be sure tio properly use code tags!!!!)
Over 80% of the time, when a person is reducing down the problem, they realize what thte problem actually is.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!) 2008, 2009 In theory, there is no difference between theory and paractice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
I agree with TheCPUWizard.
I would also add that if you wrote this code "from scratch" then you could forget some very important things.
So try to rewrite it using very useful example from Joe Newcomer's essay Serial Port programming
Bookmarks