using a modem

This is a discussion on using a modem within the C++ Programming forums, part of the General Programming Boards category; tutorial says the below code will use modem to dial a number but when a run it does not use ...

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    106

    using a modem

    tutorial says the below code will use modem to dial a number but when a run it does not use the modem what is wrong with it?



    #include &ltfstream.h>

    void main()
    {
    char c;
    ofstream modem("COM1:");
    cout << "Resetting MODEM to Dial\n";
    cout << "ATZ OK\n";
    modem << "ATZ\n";
    modem.flush();
    cout << "Anykey to dial\n";
    cin >> c;
    cout << "Dilaing!\n";
    cout << "ATDP3468444\n";
    modem <<"ATDP3468444\n";
    modem.flush();
    cout << "Press anykey to Hang-UP\n";
    cin >> c;
    modem <<"ATH0\n";
    modem.flush();
    cout << "End";
    }
    C++ Makes you Feel Better

    "Gravity connot be held reponsible for people falling in love"--Albert Einstein

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,822
    Perhaps your modem isn't on COM1

    Perhaps your OS doesn't have COM1

    It's definitely wrong to say void main

    Do you have a file called COM1 by any chance?

  3. #3
    Registered User
    Join Date
    Jun 2002
    Posts
    106
    when i was compiling i used int main() and return 0 at the end so u say this code is true yeah ?
    (i do not have a modem on my machưne but i think that it will freeze when i try to run but it made a file called COM1: )
    C++ Makes you Feel Better

    "Gravity connot be held reponsible for people falling in love"--Albert Einstein

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. PCI modem needs help
    By Jaguar in forum Tech Board
    Replies: 3
    Last Post: 09-26-2003, 02:01 AM
  2. Cable modem
    By ZakkWylde969 in forum Tech Board
    Replies: 15
    Last Post: 09-19-2003, 01:07 PM
  3. Problem in modem detection
    By khpuce in forum Networking/Device Communication
    Replies: 3
    Last Post: 08-04-2003, 06:52 AM
  4. serial port, modem not responding pls help...
    By Unregistered in forum C++ Programming
    Replies: 0
    Last Post: 07-08-2002, 06:08 AM
  5. XP with modem problems
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 06-04-2002, 05:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21