ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-users
perl-win32-users
RE: win32::Lanman Error
by Shailja Agrawal other posts by this author
May 23 2005 12:10AM messages near this date
view in the new Beta List Site
Re:Re: need help with utf8 | drag'n'drop onto desktop icon ???
Hello Rob,

I have modified the script like below


if(!Win32::Lanman::NetUserEnum("$PDC", &FILTER_NORMAL_ACCOUNT,
\@userdata))
 {
	print "Sorry, something went wrong; error: ";
	# get the error code
	print Win32::Lanman::GetLastError();
	print "\n";
	print Win32::FormatMessage( Win32::Lanman::GetLastError() );
	print Win32::Lanman::GetLastError(), " ", Win32::GetLastError(),
" ",Win32::FormatMessage(Win32::GetLastError()), "\n";

 }

And you were right in probably guessing the error right, the error from
Win32::Lanman::GetLastError() is 1726 (The remote procedure call failed)
and from Win32::GetLastError() is 0 (Request completed successfully).

I am not sure what is going wrong with this simple script as it works
sometimes and throws error other time.

Regards,
Shailja Agrawal



-----Original Message-----
From: Sisyphus [mailto:sisyphus1@[...].au] 
Sent: Thursday, May 19, 2005 1:56 PM
To: AGRAWAL,SHAILJA (Non-A-India,ex1);
perl-win32-users@[...].com
Subject: Re: win32::Lanman Error


----- Original Message ----- 
From: <shailja_agrawal@[...].com> 
To: <sisyphus1@[...].au> ;
<perl-win32-users@[...].com> 
Sent: Thursday, May 19, 2005 5:23 PM
Subject: RE: win32::Lanman Error


>  Hello Rob,
> 
>  Actually, I initially thought that because of the volume of the data
(it
>  fetches around 60k records so) I had an impression that it might take
>  some time, but your statement has raised an alarm to me.
> 

Sorry - I assumed that because it was a simple script, it would run
quickly
.... perhaps that's not the case. I have little experience in this area.

>  Also, last night the job failed again but this time I have captured
the
>  error successfully (hopefully).
> 
>  if(!Win32::Lanman::NetUserEnum("$PDC", &FILTER_NORMAL_ACCOUNT,
>  \@userdata))
>   {
>  print "Sorry, something went wrong; error: ";
>  # get the error code
>  print Win32::Lanman::GetLastError();

Instead, I would have:
print Win32::Lanman::GetLastError(), " ", Win32::GetLastError(), " ",
Win32::FormatMessage(Win32::GetLastError()), "\n";

If you find that  Win32::Lanman::GetLastError() and
Win32::GetLastError()
report different numbers, then the formatted message is probably
incorrect.
But I expect that Win32::Lanman::GetLastError() and
Win32::GetLastError() to
report the same number (in which case the formatted message should be
correct).

>   }
> 
>  Result:
>  "Sorry, something went wrong; error: 53"
> 

It would be better if you could get the error message as a string,
rather
than a number (see my attempt to do that, above). The error codes (and
their
meanings) are probably available somewhere on the MS website (among
other
places). I have them listed in my Visual Studio documentation so I
looked up
53 there. It means that "the network path was not found". Why would that
happen ?

Was that error thrown by NetUserEnum() or by NetGetDCName() ? I expect
that
if "the network path was not found" then NetGetDCName(), which gets
called
*before* NetUserEnum(), should fail - or does NetGetDCName() not need to
find the network path ?

Cheers,
Rob


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved