Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 17th, 2006, 4:43 PM   #1
hervens48
Programmer
 
Join Date: Apr 2006
Location: Montreal, Canada
Posts: 95
Rep Power: 3 hervens48 is on a distinguished road
Send a message via AIM to hervens48 Send a message via MSN to hervens48
can u access the internet with c++?

Hello people, im not a c++ expert but i manage. I feel pretty confortable with dos programming, and i just began win32 programming.
I was wandering if there is a way to access the internet with c++
What im trying to say is that can u make a program, and when u click on a button or a link, it goes to the internet.

And if tis possible, is it possible to make it in a dos program?

For exemple, u could make a dos program, and when u click 5 it goes to a site.
Please, is this possible?
If it is please send me a sample code of how it is used and its syntax.
And dotn forget, a c++ program, as its the only language i know.
hervens48 is offline   Reply With Quote
Old May 17th, 2006, 4:47 PM   #2
gryfang
Programmer
 
gryfang's Avatar
 
Join Date: May 2006
Location: Ohio
Posts: 36
Rep Power: 0 gryfang is on a distinguished road
Send a message via AIM to gryfang
Are you asking if it's possible to make an Dos based Internet Browser or do I have your question off base?
__________________
--------------------
LOAD "*" ,8,1

God bless
- Gryfang
gryfang is offline   Reply With Quote
Old May 17th, 2006, 4:47 PM   #3
hervens48
Programmer
 
Join Date: Apr 2006
Location: Montreal, Canada
Posts: 95
Rep Power: 3 hervens48 is on a distinguished road
Send a message via AIM to hervens48 Send a message via MSN to hervens48
yeah something like that
hervens48 is offline   Reply With Quote
Old May 17th, 2006, 4:48 PM   #4
hervens48
Programmer
 
Join Date: Apr 2006
Location: Montreal, Canada
Posts: 95
Rep Power: 3 hervens48 is on a distinguished road
Send a message via AIM to hervens48 Send a message via MSN to hervens48
actually im saying if tis possible to add links to a dos application that lead to teh internet
hervens48 is offline   Reply With Quote
Old May 17th, 2006, 4:53 PM   #5
.TD
Programmer
 
.TD's Avatar
 
Join Date: Feb 2006
Location: UK
Posts: 36
Rep Power: 0 .TD is on a distinguished road
To open an external browser then? Or do you want to write your own (text-based) browser? :/ (or just something that downloads files over the internet, well http protocol)
__________________
Go away before I replace you with a very small shell script.
--
Get FireFox!
.TD is offline   Reply With Quote
Old May 17th, 2006, 4:55 PM   #6
gryfang
Programmer
 
gryfang's Avatar
 
Join Date: May 2006
Location: Ohio
Posts: 36
Rep Power: 0 gryfang is on a distinguished road
Send a message via AIM to gryfang
I'm sure it's possible, what it sounds like you want to do is within the DOS program to use a System call to another DOS program. Someone better double check me on that because I usually tend to loath calling external programs in any Language (just a personal preference).
__________________
--------------------
LOAD "*" ,8,1

God bless
- Gryfang
gryfang is offline   Reply With Quote
Old May 17th, 2006, 6:19 PM   #7
Prm753
Professional Programmer
 
Prm753's Avatar
 
Join Date: Oct 2005
Location: United States
Posts: 447
Rep Power: 4 Prm753 is on a distinguished road
Send a message via AIM to Prm753 Send a message via MSN to Prm753
You mean something like this?
ShellExecute(NULL, "open", "http://www.google.com", NULL, NULL, SW_SHOWNORMAL);

Read about ShellExecute on MSDN if that's what you are looking for.
__________________
The world's first athletic computer geek!
The home of PrProgramsStudios
How not to post a question: <-- Please don't reply
Prm753 is offline   Reply With Quote
Old May 17th, 2006, 6:31 PM   #8
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
Quote:
Originally Posted by hervens48
For exemple, u could make a dos program, and when u click 5 it goes to a site.
I'm not exactly sure what you mean by this, but if you're talking about literally clicking the console window, I would assume it would be something like tracking mouse movement while inside the console window(rect). While the mouse is inside the console window, you would track the mouse location to see if it's in the location 5,5(x,y) through to 10,6, depending on how big your link would be.

I suggest maybe starting at this link if you wish to understand what I'm beginning to talk about: Mouse functions(GetCursorPos)
__________________

Quote:
Originally Posted by Mohamed Jihad
Durka durka!
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it.

Download Code::Blocks now!
jayme is offline   Reply With Quote
Old May 17th, 2006, 7:20 PM   #9
hervens48
Programmer
 
Join Date: Apr 2006
Location: Montreal, Canada
Posts: 95
Rep Power: 3 hervens48 is on a distinguished road
Send a message via AIM to hervens48 Send a message via MSN to hervens48
What im saying is if u can actually put links in ur dos application and then type a number and then click enter, since dos applications dotn accept mousses.
some thing like
5=www.google.com
6=www.programmingforums.org
u guys see what i mean?
and does sites in the dos applications are suppose to be already defined while im making the program.
Somebody proposed ShellExecute()
i had better try it, it might just be the thing.
and i want to make it in a dos application cause their way way shorter than win32 applications
hervens48 is offline   Reply With Quote
Old May 17th, 2006, 7:26 PM   #10
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
Like this?

#include <iostream>
#include <windows.h>

int main()
{
    int selection;

    std::cout << "Enter website to visit:\n"
              << "1. Google\n"
              << "2. Programming Forums\n";

    std::cin >> selection;

    switch(selection)
    {
        case 1:
            ShellExecute(NULL, "open", "http://www.google.com", NULL, NULL, SW_SHOWNORMAL);
            break;
        case 2:
            ShellExecute(NULL, "open", "http://www.programmingforums.org", NULL, NULL, SW_SHOWNORMAL);
            break;
        default:
            std::cout << "Invalid selection!";
    }
    return 0;
}

Can I know what type of program you are attempting to make? Are you just experimenting with different functions? I just like knowing about things that I'm helping somebody with.
__________________

Quote:
Originally Posted by Mohamed Jihad
Durka durka!
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it.

Download Code::Blocks now!
jayme is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:57 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC