Thanks in advance..
\\<HOST NAME>\<SHARED FOLDER>\<FILE NAME>
for example copy file from command line:
copy \\Asterix\SharedFiles\myFileName.file \RootFolderOnDevice\Folder\
same you can do with CopyFile API from your source code.
eric.
Thanks a lot...
Paul T.
"WinCELearner" <WinCEL...@discussions.microsoft.com> wrote in message
news:CE920FCB-489D-4BFA...@microsoft.com...
(Check with GetLastError() after you got an error when accessing the
host folders)
eric.
No, there shouldn't be anything else that you need to do network-wise, as
long as you can ping devices on the private network from your device.
Paul T.
"WinCELearner" <WinCEL...@discussions.microsoft.com> wrote in message
news:CA78AA7A-7927-4A31...@microsoft.com...
I called the WNetAddConnection3() API with the parameters set as below:
NETRESOURCE nr;
memset(&nr,0,sizeof(nr));
nr.lpRemoteName = TEXT("\\\\WMH643-01"); //computer name to be accessed
nr.lpLocalName = L"share";
nr.dwType = RESOURCETYPE_DISK;
DWORD dwRes = WNetAddConnection3( NULL,&nr,
NULL, // password
NULL, // username
CONNECT_UPDATE_PROFILE);
The result of the API is an error value = 53 (ERROR_BAD_NETPATH)
I have also tried giving valid username and password for
WNetAddConnection3() API but the error is still ERROR_BAD_NETPATH.
I have also changed the NETBIOS name in the WinCE device.
Please give your thoughts on this.
Thanks a lot...
I used the following code successfully:
NETRESOURCE res;
res.dwScope = RESOURCE_GLOBALNET;
res.dwType = RESOURCETYPE_DISK;
res.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE;
res.dwUsage = RESOURCEUSAGE_CONNECTABLE;
res.lpLocalName = _T( "actelprj" );
res.lpRemoteName = _T( "\\\\farside\\actelprj" );
res.lpComment = NULL;
res.lpProvider = NULL;
DWORD err;
if ( ( err = WNetAddConnection3( NULL, &res, _T( "" ), _T( "GUEST" ), 0 ) )
==
ERROR_SUCCESS )
{
// Success.
}
else
{
DEBUGMSG( 1, ( TEXT( "Error in WNetAddConnection3 = %d 0x%x\r\n" ),
err, err ) );
}
Paul T.
"WinCELearner" <WinCEL...@discussions.microsoft.com> wrote in message
news:44EFCA1E-BCF6-407A...@microsoft.com...
"Paul G. Tobey [eMVP]" wrote:
But we have the following issues:
When i try to read data using the following code
byte[] temp = new byte[1 * 1024]; // 1 KB
FileStream fs = File.Open("file", FileMode.Open,FileAccess.Read);
if (fs != null)
{
fs.Read(temp, 0, temp.Length);
}
Read/Write works fine when the "temp" buffer is small. When the size of the
buffer is increased to 1 MB, "Read" throws the following exception
41706 PID:d1fad0ea TID:f1fb5882 0x91c68ae0: WaitNib 0x3F1C70, timed out
waiting for server response after 10000 ms
41706 PID:d1fad0ea TID:f1fb5882 0x91c68ae0: Error 59 in CORE read, aborting
41706 PID:d1fad0ea TID:f1fb5882 0x91c68ae0: -RDR:ReadFromNet, returning 59
41707 PID:d1fad0ea TID:f1fb5882 0x91c68ae0: +RDR:FileRead, returning 59
41712 PID:f1c68802 TID:f1fb5882 error = 59
42198 PID:f1c68802 TID:f1fb5882 Exception = System.IO.IOException:
IOException
We get the same error when accessing a picture file mounted on \Network\ to
display it in the picture box using the following code
Image picture = new System.Drawing.Bitmap(filename);
pictureBoxObject.Image = picture;
The size of the picture file also than 1 Kilo Bytes as Read worked with 1 KB
buffer.
We thought that Network traffic could be an issue and hence tried to
increase the "TimeOut" to 20 seconds instead of the defalut 10 seconds
Registry settings are
; Redirector settings
[HKEY_LOCAL_MACHINE\Comm\Redir]
"AllowedAuthMethods"=dword:0
"ClearTxtPwdAllowed"=dword:1
; Expose \NETWORK dir for mapped resources
"RegisterFSRoot"=dword:1
"SmbSignature"=dword:0
"ServerTimoutMs"=dword:20000
Even after these changes and giving a SYSGEN in Platform Builder it used to
TimeOut in 10 seconds instead of 20 seconds.
Is it really necessary to increase the TimeOut value?
Are there any limitations on the size of the files to be accessed?
Please help us in undestanding the limitations of WNetAddConnection3().
Thanks in advance.
Paul T.
"WinCELearner" <WinCEL...@discussions.microsoft.com> wrote in message
news:C0AD98AE-2123-454E...@microsoft.com...
The network shared folder gets mounted with the “res.lpLocalName” under
\Network\.
We can access all the files and folders once mounted.
But if we don’t access any of the files/folders under the mounted path for
more than 10 min ,during the next attempt of accessing the mounted path we
get a pop-up requesting for User Credentials (user name and password).
Basically i think the network connection is lost.
Is there any way to avoid this request for User Credentials?
"Paul G. Tobey [eMVP]" wrote:
Paul T.
"WinCELearner" <WinCEL...@discussions.microsoft.com> wrote in message
news:870035FB-8252-4C50...@microsoft.com...
Also the disconnect after 10 mins seems to be because of the registry settings
ResourceExpiryInt to default 600 secs that is 10 mins..
we shall change this value to fix the timeout problem..
Thanks a lot..
Paul T.
"WinCELearner" <WinCEL...@discussions.microsoft.com> wrote in message
news:9DA1B18A-4797-4EEC...@microsoft.com...