Re: problems accessing compact flash card
From: AlanGLLoyd (alanglloyd_at_aol.com)
Date: 11/30/04
- Next message: Alan Mead: "Re: Delphi 6 vs 7 vs 8"
- Previous message: Txema: "Calling ActiveX from Delphi"
- In reply to: Nicolai Hansen: "Re: problems accessing compact flash card"
- Next in thread: Jamie: "Re: problems accessing compact flash card"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Nov 2004 16:26:01 GMT
In article <d96764ff.0411212323.7109e647@posting.google.com>, nic@aub.dk
(Nicolai Hansen) writes:
> h:=CreateFile(PChar('\\.\'+SaveForm.Drive+':'), GENERIC_ALL,
>0, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
> if integer(h)<0 then // wtf happened to if h=INVALID_HANDLE?
> CloseHandle(h);
>
MSDN says of CreateFile, Return Value ...
"If the function fails, the return value is INVALID_HANDLE_VALUE. To get
extended error information, call GetLastError."
Delphi assigns -1 to INVALID_HANDLE_VALUE.
OTOH if one has an INVALID_HANDLE_VALUE in a handle variable, should one use it
to close the file - I would have thought not, because there _is_ no valid
handle anywhere, and the file hasn't been opened so how _can_ one close it.
Have you tried opening the device with a FILE_FLAG_OVERLAPPED flag - thismakes
the file activities asynchronous.
Alan Lloyd
alanglloyd@aol.com
- Next message: Alan Mead: "Re: Delphi 6 vs 7 vs 8"
- Previous message: Txema: "Calling ActiveX from Delphi"
- In reply to: Nicolai Hansen: "Re: problems accessing compact flash card"
- Next in thread: Jamie: "Re: problems accessing compact flash card"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|