Help With WNetAddConnection2 
Author Message
 Help With WNetAddConnection2

Hi,

 I am trying to use WNetAddConnection2 to connect to a network printer. When
I try to use it what happens is that the function comes back as successful
but there is no new printer added if I look in settings, printers on the
start menu. It mentions in the docs you have to specify a few paremeters in
the NETRESOURCE structure which I have done. There is one parameter for
localname in the NETRESOURCE structure which is supposed to be a local
device you specify to redirect which seems to be my problem. I have tried
leaving this blank and the function suceeds. The same happens if I put in a
valid port like LPT2, if I put in an invalid port or say an invalid device
like z: it gives and error. I never seem to see a connection to my new
network printer. I have the remotename part of the NETRESOURCE structure as
a shared device name set to \\servername\printername which is how its shared
on our network. Again if you put in an invalid printer name it gives a
correct error. It all seems to be working but where is my printer?. If you
try file run with the same syntax it goes to add the printer to your list
configured printers.

If I try this with a drive map , i.e having localname as say z: and
remotename as \\servername\share it works fine and maps drive z. Is it
possible to use the WNetAddConneciton2 function to effectively map to a
network printer. The docs suggest it is, any assistance would be greatly
appreciated.

Thanks

Neal



Mon, 24 Feb 2003 03:00:48 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Help With WNetAddConnection2

2. Help: Logging into NT using WNetAddConnection2

3. HELP: WNetAddConnection2 and VB - SOLUTION FOUND

4. WNetAddConnection2 PLEASE HELP!

5. WNetAddConnection2 - HELP!

6. WNetAddConnection2 ...PLEASE HELP

7. WNetAddConnection2 HELP

8. WNetAddConnection2 in a service (repost)

9. WNetAddConnection2 in a service

10. DCOM: error 1312 on WNetAddConnection2

11. WNetAddConnection2 API Call ????????

12. WNetAddConnection2 & /user:domain\username

 

 
Powered by phpBB® Forum Software