Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I get the serial number of a Processor or Hard di
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00466558
Message ID:
00467216
Vues:
16
>Thank you for your reply. As stated in my email, I had used the GetVolumeInformation() API. Unfortunately on some computers the serial is
>> EEEE EEEE and this gives us a problem as VFP and the DECLARE DLL command cannot seem to handle these larger numbers.
>
>I USE :
>
>DECLARE INTEGER GetVolumeInformation In WIN32API ;
> STRING@, STRING@, LONG,LONG@, LONG@,LONG@,STRING@,LONG
>
>LOCAL cnn
>cnn=0
>pc1 = "C:\"+CHR(0)
>pc2 = SPACE(100)+CHR(0)
>pn3 = 100
>pn4 = 0
>pn5 = 0
>pn6 = 0.0000
>pc7 = SPACE(100)+CHR(0)
>pn8 = 100
>bb=GetVolumeInformation(@pc1,@pc2,pn3,@pn4,@pn5,@pn6,@pc7,pn8)
>
>The serial number comes back in pn4 but on some computers the number is coming back in scientific notation like -1.66879e+9
>and this is giving errors in the calculation.

This is because all integers in VFP are signed. In a situation like this, I would pass a string and convert the string.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform