- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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
링크가 복사됨
2 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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