in reply to Failure to load Win32::NetResource

From a cursory scan of the MSDN pages for the API's imported by NetResource.dll, it looks like they should all be available under '98. However, if you are passing in strings that contain wide chars, then the code will be trying to use the xxxW versions of the APIs and these are only available under '98 if you have installed MS Layer for Unicode.

You might be able to bypass the problem by using Win32::Api to use the ascii suffix versions of the apis directly, but if your UNC contain wide chars, that may not help.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re^2: Failure to load Win32::NetResource
by bart (Canon) on Sep 13, 2004 at 21:53 UTC
    Well I tried the alternative route, as per your suggestion:
    use Win32::API; my $netShareGetInfo = Win32::API->new('NETAPI32', 'NetShareGetInfo', ' +PPNP', 'N') or die "Can't initialize function";
    Again, this loads fine on XP and fails on Win98. NETAPI32.DLL does exist, in Windows's system directory.

      Maybe this is the cause?

      Platform SDK: Network Management NetShareGetInfo The NetShareGetInfo function retrieves information about a particular shared resource on a server. Windows Me/98/95: The parameters for this function are different from those listed in the syntax block. For more information and syntax, see the Windows Me/98/95 information in the Remarks section.

      There is more information + a link to some sample code via the link above.

      HTH.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon