Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

WNetAddConnection

Posted on 1999-06-30
2
Medium Priority
?
350 Views
Last Modified: 2013-12-03
I tried WNetAddConnection on Windows95. It works on Win95 but not in Windows NT. I got an error : ERROR_INVALID_ADDRESS.

Can you help ?

Example:
   WNetAddConnection("\\\\MyMachine", NULL, NULL);
0
Comment
Question by:kctan100
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Expert Comment

by:Lischke
ID: 1401837
You need to supply a password for this connection under WinNT. Additionally, this funtion is only for backward compatibility with 16Bit WIndows. MSDN States you should use WNetAddConnection2.

Ciao, Mike
0
 
LVL 86

Accepted Solution

by:
jkr earned 80 total points
ID: 1401838
Lischke is right about 'WNetAddConnection2()' - but the main problem is that the address is indeed invalid, you'll have to use '\\server\share', whereas you're only supplying a server name. Use


   WNetAddConnection("\\\\MyMachine\\MyShare", NULL, NULL);

0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question