|
-
Jul 1st, 2013, 10:33 AM
#1
Thread Starter
Junior Member
How can i check if my local network connection is fine ?
Hi guys!
I've a problem with my program...
i need to connect with a network printer, but... before i need to check if i'm connect in a local network and if i can use this connection.
It's possible?
i need to find only this answer to finish my program.
One more thing, i'm working with a class to care all about printes.
i'm waiting for any help
thanks
-
Jul 1st, 2013, 11:59 AM
#2
Re: How can i check if my local network connection is fine ?
There is a IsNetworkAlive Windows api function - have a good look at this sample.
-
Jul 2nd, 2013, 06:58 AM
#3
Thread Starter
Junior Member
Re: How can i check if my local network connection is fine ?
Thank you a lot!
More 1 question...
it's possible to print something directly to network printer, only using the printer.print command?
-
Jul 2nd, 2013, 09:00 AM
#4
Re: How can i check if my local network connection is fine ?
 Originally Posted by Rumblefish
More 1 question...
it's possible to print something directly to network printer, only using the printer.print command?
If you connect to a remote printer via Windows Networking ("File and Printer Sharing") then the printer is "owned by" the Windows Print Spooler. That means you must use Printer.Print and related methods or API equivalents, which "talk to" the printer driver which passes data on to the Spooler.
Even if you prevented the printer from being a Print Spooler device and tried to connect to it directly from your program over TCP/IP you'd have to implement a remote printing protocol (LPR, etc.) that the server hosting it supports. Yes, many printers now have built in print servers but that doesn't change anything.
Another possibility is to print from your VB6 program though the Spooler but bypassing the printer driver. The printer driver is what normally converts between GDI printer "markup" and a printer's native markup language (or command set). This is usually far less effort than trying to use something like a Winsock control and write the code to look like an LPR client.
See How To Send Raw Data to a Printer Using the Win32 API from Visual Basic
Of course if you do this your program will need some way to tell which kind of printer it is dealing with and produce the required markup or commands that a specific printer requires. This is similar to the bad old DOS days, when programs had to be written to handle each kind of printer they needed to print to.
-
Jul 8th, 2013, 06:23 AM
#5
Thread Starter
Junior Member
Re: How can i check if my local network connection is fine ?
-
Jul 8th, 2013, 06:25 AM
#6
Re: How can i check if my local network connection is fine ?
Don't forget to mark the thread "Resolved".
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|