Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UNC versus drive letter
Message
De
07/12/2001 20:40:34
 
 
À
07/12/2001 20:06:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00591571
Message ID:
00591573
Vues:
21
> UNC name for the host computer drives

I chickened out and resorted to calling the Win32 Net API from an FLL function (shown below) but the same thing could easily be done with pure Fox via DECLARE DLL. Anyway, it's a lot easier than the other way round (finding drive mappings for arbitrary UNC paths).
// UNCPath (cPath, [nMode])
// nMode & 1<<0   return original path on error
FOXFUN( UNCPath )  {
   char const *s = _str_param(0, pp);
   char uni[MAX_PATH * 2];
   DWORD size = sizeof(uni);
   if (NO_ERROR == <B>WNetGetUniversalName</B>(s, UNIVERSAL_NAME_INFO_LEVEL, uni, &size))
      _RetChar(reinterpret_cast&lt;UNIVERSAL_NAME_INFO *&gt;(uni)->lpUniversalName);
   else
      _ret_str(_int_param(1, pp) & 1&lt;&lt;0 ? s : "");
} // 2001-10-12
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform