Click here to Skip to main content
15,916,091 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: simpler question Pin
DavidMLevine1-Mar-05 15:25
DavidMLevine1-Mar-05 15:25 
Generalnetwork programming Pin
santosh_akella28-Feb-05 10:34
santosh_akella28-Feb-05 10:34 
GeneralRe: network programming Pin
Dave Kreskowiak28-Feb-05 11:43
mveDave Kreskowiak28-Feb-05 11:43 
GeneralRe: network programming Pin
santosh_akella28-Feb-05 20:26
santosh_akella28-Feb-05 20:26 
GeneralRe: network programming Pin
[DK]KiloDunse28-Feb-05 22:57
[DK]KiloDunse28-Feb-05 22:57 
GeneralRe: network programming Pin
Dave Kreskowiak1-Mar-05 0:50
mveDave Kreskowiak1-Mar-05 0:50 
GeneralRe: network programming Pin
avh1-Mar-05 4:28
avh1-Mar-05 4:28 
GeneralRe: network programming Pin
Dave Kreskowiak1-Mar-05 5:12
mveDave Kreskowiak1-Mar-05 5:12 
I'm assuming your using VB6...

Using the Shell method, you don't get anything back.

A better method is to add a Reference to the Microsoft Script Host Object Model and use the WshNetwork class to add this printer connection, a sample of which can be found here[^]. This way, you'll at least get an error back if the call fails.

You'll have to modify the code a litte bit. Once the Reference is added, your code to create the WshNetwork object and use it to create the LPT1: connection would look something like this:
Dim myNetworkObj As New WshNetwork
On Error Resume Next
myNetworkObj.AddPrinterConnection "LPT1", "\\Server\Print1"
If Err.Number > 0 Then
    ' Something failed!
End If



RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: network programming Pin
avh2-Mar-05 2:58
avh2-Mar-05 2:58 
GeneralRe: network programming Pin
santosh_akella1-Mar-05 7:49
santosh_akella1-Mar-05 7:49 
GeneralRe: network programming Pin
Dave Kreskowiak1-Mar-05 8:02
mveDave Kreskowiak1-Mar-05 8:02 
GeneralPositioning Picture through word automation Pin
de_Passionate28-Feb-05 8:26
de_Passionate28-Feb-05 8:26 
GeneralIE version & plugin detection in VB6 Pin
mecracked28-Feb-05 2:59
sussmecracked28-Feb-05 2:59 
GeneralRe: IE version & plugin detection in VB6 Pin
Dave Kreskowiak28-Feb-05 4:12
mveDave Kreskowiak28-Feb-05 4:12 
GeneralInternet Connection Pin
pafell28-Feb-05 1:16
pafell28-Feb-05 1:16 
GeneralRe: Internet Connection Pin
Dave Kreskowiak28-Feb-05 3:51
mveDave Kreskowiak28-Feb-05 3:51 
GeneralFile system Pin
nitin_ion28-Feb-05 0:11
nitin_ion28-Feb-05 0:11 
GeneralRe: File system Pin
Dave Kreskowiak28-Feb-05 1:29
mveDave Kreskowiak28-Feb-05 1:29 
GeneralRe: File system Pin
CorvetteGuru28-Feb-05 14:44
CorvetteGuru28-Feb-05 14:44 
GeneralRe: File system Pin
nitin_ion28-Feb-05 16:14
nitin_ion28-Feb-05 16:14 
GeneralRe: File system Pin
CorvetteGuru28-Feb-05 16:16
CorvetteGuru28-Feb-05 16:16 
GeneralRe: File system Pin
nitin_ion28-Feb-05 18:53
nitin_ion28-Feb-05 18:53 
GeneralRe: File system Pin
Dave Kreskowiak1-Mar-05 0:47
mveDave Kreskowiak1-Mar-05 0:47 
GeneralRe: File system Pin
CorvetteGuru1-Mar-05 8:33
CorvetteGuru1-Mar-05 8:33 
GeneralRe: File system Pin
Dave Kreskowiak1-Mar-05 9:39
mveDave Kreskowiak1-Mar-05 9:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.