wanting to open IE in C++ program
Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: wanting to open IE in C++ program

  1. #1
    IT Specialist Ghost_25inf's Avatar
    Join Date
    Sep 2001
    Location
    Michigan
    Posts
    648

    Question wanting to open IE in C++ program

    Hello

    Im need some code that will help me add web access into my program. just some simple line that will tell the program to open a certain site up as the program runs sorta like if I wanted to run calculator in C++ I would use this

    system("calc");

    so is there something I can put in this to open internet explorer and go to a certain page?
    S25vd2xlZGdlIGlzIHBvd2VyIQ

  2. #2
    Senior Member
    Join Date
    May 2003
    Posts
    207
    try setting your PATH envirornment variable to wherever iexplore.exe is... then run this code:
    Code:
    system("iexplore.exe <link goes here>");
    
    -or-
    
    system("c:\\program files\\internet explorer\\iexplore.exe <link goes here>");
    best of luck!!

  3. #3
    IT Specialist Ghost_25inf's Avatar
    Join Date
    Sep 2001
    Location
    Michigan
    Posts
    648
    I get a syntex error here is the program I am making.

    # include<iostream>
    using namespace std;
    int main()
    {
    float ConnectionSpeed=0.0;
    float FileSize=0.0;
    float Conversion=0.0;
    double min=0.0;

    // Opening Statement made here.

    cout << " This program will calculate the time it will take" << endl;
    cout << " your crappy computer to download the file you want" << endl;
    cout << " please visit http://bandwidthplace.com/speedtest/" << endl;
    cout << " To find out what your True bandwidth is." << endl;
    cout << endl;
    // add link to site to open here.
    // User enters data here.

    cout << " Enter your connection speed in Kb: ";
    cin >> ConnectionSpeed;
    system ("cls");
    cout << " Enter your File size in MB: ";
    cin >> FileSize;
    system ("cls");

    // calculations made here.

    FileSize = FileSize * 1000000;
    ConnectionSpeed = ConnectionSpeed * 1000;
    ConnectionSpeed = ConnectionSpeed / 8;
    Conversion = FileSize / ConnectionSpeed;
    min = Conversion / 60;

    // results returned.

    cout << " It will take you " << min << " Minutes to download that file." << endl;
    cout << endl;
    cout << " ***** Built by InfantryGhost *****" << endl;

    // End of program.

    return 0;
    }
    S25vd2xlZGdlIGlzIHBvd2VyIQ

  4. #4
    Senior Member
    Join Date
    May 2003
    Posts
    207
    syntax error... ****... let me mess with it a little, i'll let ya know if I get it to work, k?

  5. #5
    IT Specialist Ghost_25inf's Avatar
    Join Date
    Sep 2001
    Location
    Michigan
    Posts
    648
    ok thanks a bunch
    S25vd2xlZGdlIGlzIHBvd2VyIQ

  6. #6
    Banned
    Join Date
    Mar 2002
    Posts
    594
    I took out the system lines and it works fine for me...

    # include<iostream>
    using namespace std;
    int main()
    {
    float ConnectionSpeed=0.0;
    float FileSize=0.0;
    float Conversion=0.0;
    double min=0.0;
    int x;

    // Opening Statement made here.

    cout << " This program will calculate the time it will take" << endl;
    cout << " your crappy computer to download the file you want" << endl;
    cout << " please visit http://bandwidthplace.com/speedtest/" << endl;
    cout << " To find out what your True bandwidth is." << endl;
    cout << endl;
    // add link to site to open here.
    // User enters data here.

    cout << " Enter your connection speed in Kb: ";
    cin >> ConnectionSpeed;
    cout << " Enter your File size in MB: ";
    cin >> FileSize;

    // calculations made here.

    FileSize = FileSize * 1000000;
    ConnectionSpeed = ConnectionSpeed * 1000;
    ConnectionSpeed = ConnectionSpeed / 8;
    Conversion = FileSize / ConnectionSpeed;
    min = Conversion / 60;

    // results returned.

    cout << " It will take you " << min << " Minutes to download that file." << endl;
    cout << endl;
    cout << " ***** Built by InfantryGhost *****" << endl;
    cin >> x;

    // End of program.

    return 0;
    }
    What are those system lines supposed to do?

    jag291

  7. #7
    Senior Member
    Join Date
    May 2003
    Posts
    207
    yea... the program runs fine as is, thats because he had it working. But look in the code where he has the comment:
    Code:
    // add link to site to open here.
    he wants a code that will run IE to a link specified... the system code I posted was an attempt at that.

  8. #8
    Banned
    Join Date
    Mar 2002
    Posts
    594
    Missed that.. I'll take a stab it.. and get back to you...

  9. #9
    IT Specialist Ghost_25inf's Avatar
    Join Date
    Sep 2001
    Location
    Michigan
    Posts
    648
    // this stands for internal comments any time you use // it voids out anthing after it in that line only, you can also use */ then text and this to close it /*
    S25vd2xlZGdlIGlzIHBvd2VyIQ

  10. #10
    Senior Member
    Join Date
    May 2003
    Posts
    207
    Originally posted here by Ghost_25inf
    // this stands for internal comments any time you use // it voids out anthing after it in that line only, you can also use */ then text and this to close it /*
    actually, ya got it backwards... blocked comment codes are like this
    Code:
    /*  
    comments
    some more commends
    yea, i'll keep commenting
    */

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •