Help ! on Shared Files

Just starting out? Need help? Post your questions and find answers here.
ADN
User
User
Posts: 17
Joined: Fri May 16, 2003 9:25 am
Location: France

Help ! on Shared Files

Post 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)
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

???

Post by thefool »

what error :?:
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

ok

Post 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
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post 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
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
Post Reply