![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
|
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. |
|
|
|
|
|
#2 |
|
Programmer
|
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 |
|
|
|
|
|
#3 |
|
Programmer
|
yeah something like that
|
|
|
|
|
|
#4 |
|
Programmer
|
actually im saying if tis possible to add links to a dos application that lead to teh internet
|
|
|
|
|
|
#5 |
|
Programmer
Join Date: Feb 2006
Location: UK
Posts: 36
Rep Power: 0
![]() |
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)
|
|
|
|
|
|
#6 |
|
Programmer
|
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 |
|
|
|
|
|
#7 |
|
Professional Programmer
|
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 |
|
|
|
|
|
#8 | ||
|
Professional Programmer
|
Quote:
I suggest maybe starting at this link if you wish to understand what I'm beginning to talk about: Mouse functions(GetCursorPos)
__________________
▄▄▄▄ Quote:
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! ▄▄▄▄ |
||
|
|
|
|
|
#9 |
|
Programmer
|
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 |
|
|
|
|
|
#10 | |
|
Professional Programmer
|
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:
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! ▄▄▄▄ |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|