- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to get the serial number for security.
The following code works on some computers but not on others, then I ger error 'The specified path is invalid'.
If I relpace lpszDiveName with NULL I get the error when compiling -
'The type of the actual argument differs from the type of the dummy argument'
Any ideas how I can get this call to work?
Thanks, David
The following code works on some computers but not on others, then I ger error 'The specified path is invalid'.
lpszDriveName='c:' bRC=GetVolumeInformation(lpszDriveName,Volume,50,LOC(lpVolumeSerialNo),NULL,NULL,lpszSystemName,32)
If I relpace lpszDiveName with NULL I get the error when compiling -
'The type of the actual argument differs from the type of the dummy argument'
Any ideas how I can get this call to work?
Thanks, David
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, zero-terminate lpszDriveName :-). The behaviour you get is "unexpected" -- it depends on what's in memory imediately behind lpszDriveName -- if it's zero, it works, otherwise doesn't.
Since lpszDriveName is declared as CHARACTER, you cannot send NULL, which is INTEGER. You can use NULL_CHARACTER constant declared in DFWINTY or %VAL(0) -- something like that, not sure about the right syntax -- maybe %REF(0).
Jugoslav
Since lpszDriveName is declared as CHARACTER, you cannot send NULL, which is INTEGER. You can use NULL_CHARACTER constant declared in DFWINTY or %VAL(0) -- something like that, not sure about the right syntax -- maybe %REF(0).
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
NULL_CHARACTER or %VAL(0) will work.
Steve
Steve

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