Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!dkuug!rcbal!neh From: neh@rci.dk (Niels Erik Holm) Newsgroups: comp.windows.ms.programmer Subject: Using BuildCommDCB Keywords: BuildCommDCB,serial communication Message-ID: <1991Jun06.135525.5558@rci.dk> Date: 6 Jun 91 13:55:25 GMT Organization: RC International, Copenhagen, Denmark Lines: 35 I'm writing a terminal emulator program, in which I use the BuildCommDCB function. However I've experienced some strange behaviour: The code is something like: char CommSettings[] = "com1:96,n,8,1"; DCB CommDCB; BuildCommDCB((LPSTR)CommSettings,&CommDCB); I would expect that the BuildCommDCB function parses the CommSettings string and fills in the fields in the CommDCB structure. What I get is however: CommDCB.BaudRate = 0x0825 // Why not 9600 ? CommDCB.ByteSize = 0; // Why not 8 ? ... ... If I later explicitly sets the BaudRate field to 9600 (decimal) and calls the SetCommState function, I get a "Invalid Baudrate" error code. Anybode, who knows what going on ?? Best regards Niels Erik Holm RC International Denmark neh@rci.dk --------------------------------------------------------------------------- Every day, once a day, give yourself a present. Don't plan it, don't wait for it, just... let it happen. Could be a new shirt at the men's store, a catnap in your office chair, or two cups of good, hot, black coffee. (Dale Cooper in Twin Peaks). ---------------------------------------------------------------------------