Archived

This topic is now archived and is closed to further replies.

Connecting 2 computers with C++

This topic is 5012 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

We have 2 computers at home, but we have only 1 printer, and an e-mail that will refuse to send anything more than 2 megabytes. I was thinking to write something that will connect the 2 computers (Both computers have DSL that is up and running 24/7). I want to be able to open this program on the printer-less computer and type in print "C:/WINDOWS/Desktop/Something.txt" and the other computer will have a pop up warning the user on the other computer is attempting to print so-and-so, and if the receiver so desires, he could let the other person print it automatically. I haven''t the leastest idea how to do this, and I don''t ask for anyone to post a book-long guide on this. All I want is tips on what I should look for... I don''t exactly know what this is called (networking?). Anyhow, I''m hoping C++ is able to handle this sort of thing, but what should my search keywords be for this topic? ------------------------------------------------------------ .:<<-v0d[KA]->>:.

Share this post


Link to post
Share on other sites
why wouldn't you just spend $50 on a network hub and put them on the same LAN by just plugging them in to it?

or better yet just lose 1 of the DSL connections, buy a linksys DSL Router (or your favorite brand of network products) and build a LAN (again by just plugging them in to it. you'd save money that way by only having to pay for 1 DSL connection AND get a nice LAN to boot. once the computers are on a LAN you can just use windows's print sharing service thinger.

writing an app to do this seems like a major waste of time unless you just want to do it for the fun of it.

-me

[edited by - Palidine on March 25, 2004 8:59:29 PM]

Share this post


Link to post
Share on other sites
or just share a folder on one computer and push the file across the LAN. heh, the numbers of ways you can solve this problem without any code are staggering

-me

Share this post


Link to post
Share on other sites
quote:
Original post by Palidine
writing an app to do this seems like a major waste of time unless you just want to do it for the fun of it.
Agreed.

For the fun of it, you must make two kind of application, one is the server, one is the client. The server application is on the computer with access to the printer. The client application is on the computer without access to the printer. The client application will send packets (what you want to print) to the server. When the server receives a packet, it will inform the user that the packet is coming and the printer will be used to print it.

I am not good at networking though, so it might be wrong.

Share this post


Link to post
Share on other sites
We DO have a dsl router. But what da hell is a LAN??

Anyways, one of our computers is Windows 98, the other is XP. I don''t really know about this print sharing device thingy, the only thing our 2 computers share is the fact that they''re computers.

And, you say C++ is too low level for this... Then what is good enough?

------------------------------------------------------------
.:<<-v0d[KA]->>:.

Share this post


Link to post
Share on other sites
quote:
Original post by v0dKA
We DO have a dsl router. But what da hell is a LAN??



LAN = Local Area Network

ok, if you have both computers running through the same DSL connection then they can already talk to each other, i.e. it's a LAN. you can access one computer from another by doing this in explorer:

//name_of_computer

from the computer with a printer you can either share a folder or share the printer:

sharing a folder:
right click the folder ->Sharing->you can figure it out from here
then you can access if from the other computer by going:
//name_of_computer
and then just drag & drop your document into that folder
run to the other computer and then just print it b/c the file is now on that machine

sharing a printer:
start->settings->printers (or control panels->printers)
right click the printer -> Sharing -> you can figure it out from here
once the printer is shared you can add it from the other computer through it's add printer wizard found in start->settings->printers or soemthing like that
then select add network printer

to find that network name of a computer:
right-click My Computer -> properties -> click on networking or computer name (just look through the tabs you'll find it). then you have the computer name.


you can also maybe find the other computer by browsing around in your Network Neighborhood.

-me

p.s. welcome to the future

[edited by - Palidine on March 25, 2004 9:14:45 PM]

Share this post


Link to post
Share on other sites
Here's the jist. i've left out some lower level details

In the control panel (start >> control panel) for the computer with the printer, double click the printers button. find the printer in the window and right click it. You'll see an option for sharing. Go in there and tell it to share that printer.

Now, go to the other computer. again, control panel >> printers. double click add a printer. Then follow the directions in the wizard (for the first screen, you'll probably have to click that you're looking for a network printer as opposed to a local one). You might have to install drivers on the computer without the printer.

Now, when you click print in applications on the printerless computer, you should see the network printer as an option of which printer to use.

There might be some complications resulting in using windows 98, which is a terrible operating system.

EDIT: too slow, i guess

[edited by - kdogg on March 25, 2004 9:19:10 PM]

Share this post


Link to post
Share on other sites