home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / os2 / apps / 8007 < prev    next >
Encoding:
Text File  |  1992-11-08  |  871 b   |  26 lines

  1. Newsgroups: comp.os.os2.apps
  2. Path: sparky!uunet!destroyer!gatech!nntp.msstate.edu!Isis.MsState.Edu!it1
  3. From: it1@ra.msstate.edu (Tim Tsai)
  4. Subject: Borland C++ 3.1 for Windows
  5. Message-ID: <it1.721250566@Isis.MsState.Edu>
  6. Organization: Mississippi State University
  7. Date: Sun, 8 Nov 1992 19:22:46 GMT
  8. Lines: 16
  9.  
  10.   Has anybody used the Windows communications API under Borland C++ 3.1
  11. yet?  I copied the example from Borland C++'s help (basically it opens
  12. COM2: and sets it to 19,200 baud, and that's it!).  I noticed that if I
  13. do *not* close the COM port when the program terminates, WPS locks up.
  14. Closing the COM port sometimes will generate a General Protection fault.
  15. Any ideas?
  16.  
  17.   Here's the code fragment from memory:
  18.  
  19.   idComDev = OpenComm("COM2", 1024, 128);
  20.   err = BuildCommDCB("COM2:19200,n,8,1", &dcb);
  21.   SetCommState(&dcb);
  22.  
  23.   Thanks..
  24.  
  25.   PS:  Mouse is on COM1
  26.