?
Solved

WNetAddConnection

Posted on 1999-06-30
2
Medium Priority
?
356 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
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

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

588 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