Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems using API
Message
De
18/08/1999 10:25:56
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Problems using API
Divers
Thread ID:
00254972
Message ID:
00254972
Vues:
58
I am trying to use WNetGetUser in vfp. I have declared the function before using it. But for some reason I get an error, 1726 'API Library not found'. One last note, the error does not occur till after the function has already ran and returns the correct value.

One last note, the dll hooked up is C:\Windows\System\MPR.DLL


Here is the function I am using:
*==============================================================================
* Method: GetDefaultUserName
* Purpose: Gets the name of the user logged onto the machine at the * operating system level.
* Author: F1 Technologies
* Parameters:
* Returns:
*==============================================================================
LOCAL ;
lcNull, ;
lcUserId, ;
lnLen

lcNull=""
lcUserId=SPACE(255)
lnLen=255

* Use the WNetGetUser function in the Win32API to get the user id
DECLARE INTEGER WNetGetUser IN WIN32API String @, String @, Integer @
IF WNetGetUser(@lcNull,@lcUserId,@lnLen)=0
lcUserId=UPPER(LEFT(lcUserId,AT(CHR(0),lcUserId)-1))
ELSE
lcUserId = ""
ENDIF

RETURN ALLTRIM(lcUserId)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform