Re: Accessing XP Machine from a WinCE device through Network



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...

"Paul G. Tobey [eMVP]" wrote:

Well, as you might imagine, you *do* need to log in! You could connect to
the shared resource using the WNet functions, where you can specify the user
name and password to use, in your code, rather than trying to do things the
easy way (by ignoring the fact that you're accessing a shared file). If the
share is protected, you must pass it a user name and password. If it's set
to allow anyone, it seems to me that the login dialog shouldn't pop up, but
I don't remember clearly whether I've done that. If you have *no* way to
enter characters on the device, then, obviously, you're going to have to
configure the server to share whatever you need shared with no protection at
all...

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" <WinCELearner@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CA78AA7A-7927-4A31-8AD2-EF1AA19BE494@xxxxxxxxxxxxxxxx
Thanks a lot Eric and Paul for your valuable suggestions.
I added the SMB catalog item in the OS Image and changed the name in the
NETBIOS as you had mentioned.Now when I try to open a picture file
using fopen giving the \\<HOSTNAME>\<SHAREDFOLDER>\File,
I get a popup for the username , password, domain.I am trying to this in a
application for a Set top box where i do not have the keyboard to type in
characters etc,
So is there a possibility to allow access to the host without this Login
screen?
Do we need to make any changes to the Host machine for the access level.
Currently the folder sharing is with full write permission.
Also, please note that I am trying to this with 2 NICs in the host
machine.One for Public internet access and One in the private network with
the STB.I am trying to access the files in the host network through the
NIC
for the private network.
So is there something I need to do for this setup.
Please advice.
Thanks in advance for ur help

"eric" wrote:

It is like Paul said- first check if CIFS/SMB is included into your
wince kernel image.

(Check with GetLastError() after you got an error when accessing the
host folders)

eric.




.



Relevant Pages

  • Re: Accessing XP Machine from a WinCE device through Network
    ... long as you can ping devices on the private network from your device. ... So is there a possibility to allow access to the host without this Login ... Currently the folder sharing is with full write permission. ... please note that I am trying to this with 2 NICs in the host ...
    (microsoft.public.windowsce.embedded)
  • Re: Sending HTTP request
    ... Using gethostbyname() API you'll be able to get the host address. ... With socketAPI you'll create a new socket descriptor. ... have headers files for C language (both struct definition and function ...
    (comp.sys.ibm.as400.misc)
  • Re: How to achieve bidirectional load-time linking
    ... Consider a host application that allows users to author plugins as ... dynamic libraries. ... The host needs to call the plugin to ask it to ... If the functions in API are encapsulated, data-wise, no problem: ...
    (comp.lang.misc)
  • How to achieve bidirectional load-time linking
    ... Consider a host application that allows users to author plugins as dynamic libraries. ... The host needs to call the plugin to ask it to perform, and also provides an API which the plugin can call: ...
    (comp.lang.misc)
  • Re: Caching DNS and A names...
    ... conflict with the public domain 'lordynet.org'. ... private domain name of 'home.' ... So ftp.lordynet.org is set at the ISP to point to a host in the ... a host on the private network. ...
    (comp.unix.bsd.freebsd.misc)

Loading