Page 1 of 1

Help ! on Shared Files

Posted: Thu Dec 11, 2003 9:47 pm
by ADN
Hi !
Where is the error ?
Thanks

Code: Select all

Structure NETRESOURCE
  dwScope.l
  dwType.l
  dwDisplayType.l
  dwUsage.l
  lpLocalName.l
  lpRemoteName.l
  lpComment.l
  lpProvider.l
EndStructure

*buffer_resultat=AllocateMemory(1,20000,0)
*buffer_taille=AllocateMemory(1,20000,0)

handle=WNetOpenEnum_(#RESOURCE_GLOBALNET,#RESOURCETYPE_ANY,0,0,resultat$)

WNetEnumResource_(handle,50,*buffer_resultat,@buffer_taille)

Debug PeekS(*buffer_resultat\lpRemoteName.l)

???

Posted: Thu Dec 11, 2003 9:58 pm
by thefool
what error :?:

ok

Posted: Thu Dec 11, 2003 10:02 pm
by thefool
ok now i told you to tell the error. the only errors i find is in the
Structure NETRESOURCE
and is because netrescource is reserved.

and in the last line,
because you use a / instead of , to seperate.

peek needs 2 "things" but you only give them one.


Im a newbie, and this is just my answer. not sure if its correctly

Posted: Thu Dec 11, 2003 10:26 pm
by Codemonger

Code: Select all

*buffer_resultat=AllocateMemory(1,20000,0) 
*buffer_taille=AllocateMemory(1,20000,0) 
- You should use a different Memory# in AllocateMemory

- You should assign the "*buffer_resultat" variable a structure so you can do the following PeekS(*buffer_resultat\lpRemoteName.l), like:

*buffer_resultat. NETRESOURCE