Here is a Win32 API call.  How do you format it to work in EBASIC?
BOOLEAN GetVolumeInformation(LPCTSTR lpRootPathName,LPTSTR lpVolumeNameBuffer,DWORD nVolumeNameSize,LPDWORD lpVolumeSerialNumber,LPDWORD lpMaximumComponentLength,LPDWORD lpFileSystemFlags,LPTSTR lpFileSystemNameBuffer,DWORD nFileSystemNameSize)
Thanks,
Clint
			
			
			
				DECLARE "kernel32.dll" Alias "GetVolumeInformationA",GetVolumeInformation(lpRootPathName:STRING, lpVolumeNameBuffer:STRING, nVolumeNameSize:INT, lpVolumeSerialNumber:INT, lpMaximumComponentLength:INT, lpFileSystemFlags:INT, lpFileSystemNameBuffer:STRING, nFileSystemNameSize:INT),INT
Larry
			
			
			
				Thanks Larry.  Will try it.
			
			
			
				I tried it and received a syntax error.  It was like a comma was generating the error.  It looked OK to me.  What is it?
			
			
			
				I'm wanting to retrieve the serial number off of a harddrive.  It doesn't seem to be working.  It looks like you need pointers and I'm not sure how to do that.
Thanks
			
			
			
				Quote from: ckoehn on January 16, 2010, 05:45:19 PM
I tried it and received a syntax error.  It was like a comma was generating the error.  It looked OK to me.  What is it?
Post some code so we can see the error.
Larry
			
 
			
			
				DECLARE "kernel32.dll" Alias "GetVolumeInformationA",GetVolumeInformation(lpRootPathName:STRING, lpVolumeNameBuffer:STRING, nVolumeNameSize:INT, lpVolumeSerialNumber:INT, lpMaximumComponentLength:INT, lpFileSystemFlags:INT, lpFileSystemNameBuffer:STRING, nFileSystemNameSize:INT),INT'
Compiling...
Test.eba
File: C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\SongIndex2009.eba (32) syntax error - Alias
File: C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\SongIndex2009.eba (32) syntax error - ,
File: C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\SongIndex2009.eba (32) syntax error - ,
File: C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\SongIndex2009.eba (32) syntax error - ,
File: C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\SongIndex2009.eba (32) syntax error - ,
File: C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\SongIndex2009.eba (32) syntax error - ,
File: C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\SongIndex2009.eba (32) syntax error - ,
File: C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\SongIndex2009.eba (32) syntax error - ,
File: C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\SongIndex2009.eba (32) syntax error - )
Error(s) in compiling "C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\Test.eba"
			
			
			
				Sorry, my bad.  I used an old declaration.
Try this:
DECLARE IMPORT,  GetVolumeInformationA Alias GetVolumeInformation(lpRootPathName:STRING, lpVolumeNameBuffer:STRING, nVolumeNameSize:INT, lpVolumeSerialNumber:INT, lpMaximumComponentLength:INT, lpFileSystemFlags:INT, lpFileSystemNameBuffer:STRING, nFileSystemNameSize:INT),INT'
Larry
			
			
			
				Here is my program.  It still doesn't work.
DECLARE IMPORT,  GetVolumeInformationA Alias GetVolumeInformation(lpRootPathName:STRING, lpVolumeNameBuffer:STRING, nVolumeNameSize:INT, lpVolumeSerialNumber:INT, lpMaximumComponentLength:INT, lpFileSystemFlags:INT, lpFileSystemNameBuffer:STRING, nFileSystemNameSize:INT),INT
DEF win:WINDOW
DEF VolName,FileSysName:STRING
DEF ret,SerialNumber:INT
OPENWINDOW win,0,0,600,350,@SIZE|@MINBOX|@MAXBOX,0,"Test",&mainwindow
ret=GetVolumeInformation("C",VolName,254,SerialNumber,0,0,FileSysName,254)
MOVE win,10,10
PRINT win,"Serial Number: "+Str$(SerialNumber)
run=1
WAITUNTIL run=0
CLOSEWINDOW win
END
SUB mainwindow
	SELECT @CLASS
		CASE @IDCLOSEWINDOW
			run=0
		CASE @IDCREATE
			CENTERWINDOW win
	ENDSELECT
ENDSUB
Here is the errors.
Compiling...
Test.eba
File: C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\Test.eba (9) Warning: undeclared function 'GetVolumeInformation'
C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\Test.a:89: error: symbol `GetVolumeInformation' undefined
C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\Test.a:232: error: phase error detected at end of assembly.
Error(s) in assembling "C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\Test.a"
			
			
			
				try the correct function name ;)
ret=GetVolumeInformationA("C",VolName,254,SerialNumber,0,0,FileSysName,254)
Larry
			
			
			
				I did and this is what I received.
DECLARE IMPORT,  GetVolumeInformationA Alias GetVolumeInformation(lpRootPathName:STRING, lpVolumeNameBuffer:STRING, nVolumeNameSize:INT, lpVolumeSerialNumber:INT, lpMaximumComponentLength:INT, lpFileSystemFlags:INT, lpFileSystemNameBuffer:STRING, nFileSystemNameSize:INT),INT
DEF win:WINDOW
DEF VolName,FileSysName:STRING
DEF ret,SerialNumber:INT
OPENWINDOW win,0,0,600,350,@SIZE|@MINBOX|@MAXBOX,0,"Test",&mainwindow
ret=GetVolumeInformationA("C",VolName,254,SerialNumber,0,0,FileSysName,254)
MOVE win,10,10
PRINT win,"Serial Number: "+Str$(SerialNumber)
run=1
WAITUNTIL run=0
CLOSEWINDOW win
END
SUB mainwindow
	SELECT @CLASS
		CASE @IDCLOSEWINDOW
			run=0
		CASE @IDCREATE
			CENTERWINDOW win
	ENDSELECT
ENDSUB
Compiling...
Test.eba
No Errors
Linking...
Emergence Linker v1.12 Copyright ÂÃ,© 2009 Ionic Wind Software
Unresolved external __imp_GetVolumeInformation
Error: Unresolved extern __imp_GetVolumeInformation
Error(s) in linking C:\Documents and Settings\All Users\Documents\Emergence BASIC\projects\Test.exe
			
			
			
				Okay, let's try this.
Forget the declare - comment it out
change the function name to this _GetVolumeInformation
Larry
			
			
			
				If that doesn't work then use the "find in files" option of the tools menu and search for GetVolumeInformation in the EBDEV\includes directory.
if you find it then use $include "whatever.inc" at the beginning of your program.
Larry
NOTE: the reason I have so much trouble is that I've got a ton of extra add-on libs and incs on my computer.
			
			
			
				This works on my computer ( thanks to Allden - 2003):
DECLARE "Kernel32.dll",GetVolumeInformationA(lpRootName:STRING,lpVolumeName:STRING,nVolumeLen:INT,lpSerial:POINTER,lpMaxComponentLength:POINTER,lpFileSystemFlags:POINTER,lpFileSystemName:STRING,nFileSystemNameLen:INT),INT 
' Declare the call 
Def name:string :'Buffer for lpRootName
Def filesystemname:string :'This will be used to return the file system name (FAT FAT32 NTFS)
Def DrivePath:string :' This string holds what path we will use in the call
Def flags,serialnumber,maxcomponentlength:int: ' Integers of the call
flags=0:serialnumber=0:maxcomponentlength=0 :' Make sure there all set to zero
DrivePath="C:\\" :'DrivePath
GetVolumeInformationA(Drivepath,name,255,serialnumber,maxcomponentlength,flags,filesystemname,255)
' Call the function
openconsole
if name<>"" then print "Drive Name=",name :' If a name is present , print that name 
print "Serial number=",serialnumber," File system=",filesystemname :' Serial number & file system name (FAT FAT32 NTFS)
print "Press any key to continue....." :'Exit code
do : until inkey$<>""
closeconsole : end
			
			
			
				Thanks Larry.  Works great.