Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

++** Borland C++ Problem**++

Options
  • 26-04-2004 10:04pm
    #1
    Registered Users Posts: 155 ✭✭


    Does any one know the code for a buttom in Borland C++ Builder to:

    'Call & open up a certain Web page on the Internet'

    Also a function that will 'open a bland .txt Notepad doucment'

    Thanks


Comments

  • Registered Users Posts: 5,335 ✭✭✭Cake Fiend


    You could probably use the system() function for both of those.


  • Registered Users Posts: 155 ✭✭tranceenigma


    Thanks for the fast Reply Ciso. I am totally new to the aread of programming ....
    Would u be able to elaborate on that "system() function" command if possible please & give a tiny explaniation on how it works aswell.

    Thank you Kindly.....


  • Moderators, Music Moderators Posts: 1,481 Mod ✭✭✭✭satchmo


    The ShellExecute() function will do that. Try:
    ShellExecute(NULL, "open", "http://www.boards.ie", NULL, NULL, SW_SHOWNORMAL);//open a webpage
    ShellExecute(NULL, "open", "c:\\MyTextFile.txt", NULL, NULL, SW_SHOWNORMAL);//open a text file in default editor
    
    For the blank text file you try using fopen() and then fclose() it again, but there's probably a better way.


  • Registered Users Posts: 5,335 ✭✭✭Cake Fiend


    I had no idea they had made Google so hard to use.

    Last time I used it, all you had to do was type a search query, in this case 'system() function', into a little box and hit the 'Google Search' button.

    The alternative would be to search the Borland manual/readme/help files.

    Yet another way, seeing as you're presumably doing this for homework of some sort, would be to either ask your lecturer, or listen in class/read your texts in the first place.

    I was deliberately vague with my reply in order to get you off your ass to do some searching.


  • Closed Accounts Posts: 256 ✭✭$lash


    
    #include<fstream> //make sure you include this header
    
    
    void main()
    {
          fstream in_out ("file1.txt", ios::in | ios::out); //opens a file for input & output
    }
    
    


  • Advertisement
Advertisement