Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get Volum number of NetWork Drive
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00335955
Message ID:
00335983
Views:
33
>Hi,
>I use the WIN32 API function GetVolumeInformation to get serial number of the disk where my application have been instaled. But when the application is installed on network drive this function always returns 0 as a serial number.
>
>Here is my code:
>
>WAIT WINDOW STR(GetVolumNum("P")) && 0
>WAIT WINDOW STR(GetVolumNum("C")) && 7444123 - disk serial number
>
>
>FUNCTION GetVolumNum
>
> LPARAMETERS driv_lett
> DECLARE GetVolumeInformation IN WIN32API AS GetVolume;
> STRING @DriveLett, STRING @VolumName, INTEGER VolumSize,;
> INTEGER @VolumNumb, INTEGER @FileLen, INTEGER @SysFlags,;
> STRING @FileType, INTEGER FileSystemLen
>
> LOCAL m_drv, m_getdrv, nvolum, xxvolum, asd
> DECLARE mm_plus[2]
> mm_plus[1] = ":"
> mm_plus[2] = "\"
> FOR asd = LEN(driv_lett) TO 2
> driv_lett = driv_lett + mm_plus[asd]
> NEXT
> m_getdrv = SPACE(256)
> nvolum = 256
> xxVolum = 0
> GetVolume(@driv_lett,@m_getdrv,@nVolum,@xxVolum,0,0,"",0)
>
>RETURN xxVolum
>
>
>TIA
>
Hi Boris,

This is a known issue with Win95/98. See MS KB article Q234741. It also provides a workaround in VC++. I haven't looked at the code closely enough to know whether or not it could be successfully translated into VFP.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform