Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Mike Gagnon
  Where is Mike Gagnon?
 Pointe Claire
 Canada
 Mike Gagnon
 To: paundian somasundaram
  Where is paundian somasundaram?
 Dindigul
 India
 paundian somasundaram
 Tags
Subject: RE: Disk partition Number
Thread ID: 249006 Message ID: 249097 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: General VFP Topics
Date: Monday, December 28, 2009 12:39:37 PM         
   


> >
> >
> > Hello,
> >
> > you can use GetVolumeInformation from win api.
> > At the end of this message is volumeInfo.prg
> >
> > You can use it like:
> > m.o=volumeInfo("C:")
> > ? m.o.VolumeSerialNumber

> > or write your own.
> >
> > regards
> > Martin
> >
> >
> >
> > * save this code as volumeInfo.prg
> > *
> > *	GetVolumeInformation(volume as string) as object
> > *
> > *
> > parameters volume as String
> > 
> > declare integer GetVolumeInformation in win32api;
> > 	string @ lpRootPathName,;					&& p1 in
> > 	string @ lpVolumeNameBuffer,;				&& p2 out
> > 	integer nVolumeNameSize,;					&& p3 in
> > 	integer @ lpVolumeSerialNumber,;			&& p4 out
> > 	integer @ lpMaximumComponentLength,;		&& p5 out
> > 	integer @ lpFileSystemFlags,;				&& p6 out
> > 	string @ lpFileSystemNameBuffer,;			&& p7 out
> > 	integer nFileSystemNameSize					&& p8 in
> > 
> > private p2,p4,p5,p6,p7,vysl
> > m.p2=space(200)
> > store 0 to m.p4,m.p5,m.p6
> > m.p7=space(200)
> > 
> > m.vysl=GetVolumeInformation(;
> > 	addbs(m.volume)+chr(0),;
> > 	@m.p2,;
> > 	len(m.p2),;
> > 	@m.p4,;
> > 	@m.p5,;
> > 	@m.p6,;
> > 	@m.p7,;
> > 	len(m.p7);
> > 	)
> > 
> > if m.vysl=0
> > 	return null
> > else
> > 	private o
> > 	m.o=createobject("empty")
> > 	=addproperty(m.o,"VolumeName",strextract(m.p2,"",chr(0)))
> > 	=addproperty(m.o,"VolumeSerialNumber",m.p4)
> > 	=addproperty(m.o,"MaximumComponentLength",m.p5)
> > 	=addproperty(m.o,"FileSystemFlags",m.p6)
> > 	=addproperty(m.o,"FileSystemName",strextract(m.p7,"",chr(0)))
> > 	return m.o
> > endif
> > 

>
> Thanks Martin.
> But the program returns a value in scientific notation ie., -2.0113E+9.
> What's wrong?
> Paundian.

This is similar use of the function that seesm to return the correct value:
http://www.news2news.com/vfp/?example=98&function=145

Mike Gagnon
Refox XI +(English version)

ENTIRE THREAD

Disk partition Number Posted by paundian somasundaram @ 12/26/2009 3:42:35 PM
RE: Disk partition Number Posted by Martin Krivka @ 12/26/2009 4:10:17 PM
RE: Disk partition Number Posted by paundian somasundaram @ 12/28/2009 3:44:38 AM
RE: Disk partition Number Posted by Mike Gagnon @ 12/28/2009 12:39:37 PM
RE: Disk partition Number Posted by Martin Krivka @ 12/29/2009 9:07:37 AM
RE: Disk partition Number Posted by Mike Gagnon @ 12/29/2009 1:36:17 PM
RE: Disk partition Number Posted by Vladimir Zografski @ 12/26/2009 8:36:47 PM
RE: Disk partition Number Posted by paundian somasundaram @ 12/28/2009 3:47:48 AM