Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Declare DLL call caused an exception (!!!)
Message
De
11/05/2001 15:39:21
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Declare DLL call caused an exception (!!!)
Divers
Thread ID:
00506373
Message ID:
00506373
Vues:
94
Here's the code:
FUNCTION SYSGetUserName
LOCAL lcUserName, lnBufSize, RetCode, NullCharPos
     
    lcUserName = REPLICATE(CHR(32), 80)
    lnBufSize = 80
    
    *---call WINAPI
    Declare Integer GetUserName IN WIN32API String @lpBuffer, Integer nSize
    RetCode = GetUserName(lcUserName, lnBufSize)
    CLEAR DLLS

    *---search for the end of the string
    NullCharPos = AT(CHR(0), lcUserName)
    IF NullCharPos > 0 THEN
        lcUserName = LEFT(lcUserName, NullCharPos - 1)
    ELSE
        lcUserName = ""
    ENDIF

    RETURN lcUserName

ENDFUNC
</CODE>
What am I doing wrong and why am I getting an error (see subject)?

Stephane.


P.S. This was taken from a VB program I wrote and the DLL call works fine in VB.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform