Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with WNetOpenEnum

Status
Not open for further replies.

sggaunt

Programmer
Jul 4, 2001
8,620
GB
This may be too general for my 'language based' forum so I hope its ok to post it here as well.

I am using WNETOPENENUM in a function for enumering network resources.
The function has worked fine on my development machine and at least four others (3 XP, 1 95B and 1 98SE), but I am getting problems on some machines, where the function returns errors, e.g 'command not supported' one one machine (W98 SE ) or 'no network present' on another (W98 SE) in both cases the machines are connected to a P2P network and network access seems to be OK from windows point of view, does anyone have any ideas why this function does not always work. Perhaps some extra windows networking componets are required?



Steve
getting better now thanks!
 
A slight mistype there the first error should have been Error 50 'Not supported'. after a lot of googling I came up with this I suspect that WMNETOPENENUM calls getnetworkparams, and the machine in question may well have IE5 installed (I need to check), can anyone add to this.
I still have to find a cause for the 'no network present' error.


Steve
getting better now thanks!
 
MSDN said: in 9X Family Unicode version of this function (WNetOpenEnumW) is supported only with MS layer for Unicode installed...
As far as I know in 9X we can work w/o network logon, but these functions works only after logon (see MSDN)...
May be it helps?..
 
Thanks ArkM
As far as I can tell the machine in question (API returns 'no Network' error) is logged onto the network.
'Client for MS networks' is installed and the network login dialog appears at startup if this is cancelled you see the windows login dialog (as normal).

Is MS Layer for Unicode an installable option for 9X?
I will do some googling.

If the function was not being supported at all would you expect to see any meaningful erro codes?

I have since checked the code that uses the API call on the remaining two machines on our network (7 in total) this is the only one where it dosnt work!
The only difference I do know about, is that all the other machines are set-up to use auto-logon via the TweakUI power Toy.


Steve
getting better now thanks!
 
Ah I see. My application is written in Borland Delphi, as far as I know all the API functions are 'wrappers' for the OS API.
The language help on WNETOPENENUM (No W postfix version is listed) does not mention the need to install any librarys.
This would be most unusual for a Delphi API call.
In fact it specifical states that the function is Win95 compatable.
Also it dosent explain why the function works Ok on most machines.
(I will ask about the unicows library in the Delphi forum)


Steve
getting better now thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top