Re: Accessing XP Machine from a WinCE device through Network
- From: WinCELearner <WinCELearner@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 4 Mar 2009 06:28:10 -0800
Hi Paul,
Thanks a lot for the timely help and suggestions.After making the
modifications as per suggestions, I was able to mount the Shared drive in the
XP machine in my CE device.I am able to write/read files in the network path.
Currently I am facing some issues with loading a picture file from the
Shared Folderin the C# application running in WinCE device.
I will keep you posted on the progress or issues.
Once again , thanks a lot.
"Paul G. Tobey [eMVP]" wrote:
The remote name is the computer name AND the share name, \\WMH643-01\share..
You also have to carefully consider your choice of parameters for user name
and password. NULL means something significant to the call and it's
probably not what you think.
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" <WinCELearner@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:44EFCA1E-BCF6-407A-BF32-6A511BDCD338@xxxxxxxxxxxxxxxx
Hi Paul,
Thanks for your comments.As per your suggestion, I added the WNet
Functions.
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...
- References:
- Re: Accessing XP Machine from a WinCE device through Network
- From: WinCELearner
- Re: Accessing XP Machine from a WinCE device through Network
- From: Paul G. Tobey [eMVP]
- Re: Accessing XP Machine from a WinCE device through Network
- From: WinCELearner
- Re: Accessing XP Machine from a WinCE device through Network
- From: Paul G. Tobey [eMVP]
- Re: Accessing XP Machine from a WinCE device through Network
- Prev by Date: Re: WinCE 6 external cellular modem RAS dial
- Next by Date: How do you intercept USB printer error messages when using StartDoc()/EndDoc()?
- Previous by thread: Re: Accessing XP Machine from a WinCE device through Network
- Next by thread: RE: Accessing XP Machine from a WinCE device through Network
- Index(es):
Relevant Pages
|
Loading