- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using GetVolumeInformation to get the serial number.
I am expecting an integet*4 value to be returned.
Thisis what I get on my computer, but on another computer I get 49,684,256,597,454
Iexpect integer*4 to be in the range -2,147,483,648 to 2,147,483,647.
What is going on?
David
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You must have an INTEGER*8 variable in there somewhere or else you wouldn't even be able to display a value that large. How is it receiving the value? What does your code look like?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Code:
integer*4 Function VolSerialNo ! ------------------------------ ! get volume serial number use dfwin integer*4 lpVolumeSerialNo character lpszDriveName*50,lpszSystemName*50,Volume*50 logical*4 bRC lpszDriveName='c:'//char(0) bRC=GetVolumeInformation(lpszDriveName,Volume,50,LOC(lpVolumeSerialNo),NULL,NULL,lpszSystemName,32) VolSerialNo=iabs(lpVolumeSerialNo) end function
Here is my code to get the volume number, it is an integer*4
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, how do you call this function and display the value? Is the function name declared as INTEGER*3 in the caller?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was being silly - I was doing other things between calling the function and displaying the result

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page