Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!uunet!mcsun!unido!rwthinf!slcdec!hippo!f1.n6000.z2.fidonet.org!p4.f36.n245.z2.fidonet.org!Norbert_Unterberg From: Norbert_Unterberg@p4.f36.n245.z2.fidonet.org (Norbert Unterberg) Newsgroups: comp.windows.ms.programmer Subject: Re: Modem Hangup from inside Win 3.0 App Message-ID: <1602934125@p4.f36.n245.z2.fidonet.org> Date: 31 May 91 09:52:00 GMT Article-I.D.: p4.1602934125 References: <7334@p1.f6.n242.z2.fidonet.org> Reply-To: Norbert_Unterberg%p4.f36.n245.z2@hippo.dfv.rwth-aachen.de (Norbert Unterberg) Organization: Point of SoftStream, Dortmund, Germany Lines: 30 Comment-To: _Bruce_Oneel_@f1.n6000.z2.fidonet.org (Bruce Oneel) > I am writing a Windows 3.0 application that is utilizing > a modem to access a database system, download data and then > terminating > the connection. I can not get the application to hang up the modem > after the data transfer is complete. I need a way to drop DTR from > inside the Windows application. If anyone has experienced this > problem and has a way to do it, I would be most thankful. I have > tried to get the modem attention by send +++ and waiting for the > string OK, but on a 2400 baud modem this does not seem to work. Windows provides an easy way to manage the signals DTR and RTS. Just use EscapeCommFunction(nCid, CLRDTR). Your other problem: As far as I know, +++ places the modem into the the command mode, but it does not answer with "OK". Try the following: - Flush the output buffer or wait until it is empty. (important!) - Wait for 2 seconds - Send a "+++" (without CR) - Wait for output buffer empty - Wait for 2 seconds - Send "AT" followed by a CR. Now the modem should respond with an "OK" string and can safely assumed to be in command mode. Norbert Dortmund, Germany