Re: Delphi problem with Laptop



Gert Baars wrote:
The following:

// create handle to serial port
procedure TCustomComPort.CreateHandle;
begin
FHandle := CreateFile(
PChar('\\.\' + FPort),
GENERIC_READ or GENERIC_WRITE,
0,
nil,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
0);

if FHandle = INVALID_HANDLE_VALUE then
raise EComPort.Create(CError_OpenFailed, GetLastError);
end;


is from CPORTLIB3.0 VCL that raises
the exeption (open error) only on Laptop
and not on the PC (either with or without
File I/O error checking on).
How could this be solved?

file name should be like
COM1: COM2: COM2: etc..
the use of \\.\ is for non mapped devices if i remember?


--
"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5

.



Relevant Pages

  • Re: Delphi problem with Laptop
    ... FHandle:= CreateFile( ... PChar('\\.\' + FPort), ...
    (alt.comp.lang.borland-delphi)
  • Delphi problem with Laptop
    ... FHandle:= CreateFile( ... PChar('\\.\' + FPort), ... File I/O error checking on). ...
    (alt.comp.lang.borland-delphi)
  • GetClassName bringt error_access_denied
    ... ich experimentiere ein bißchen mit der WinAPI und versuche mal, ... fhandle, shandle: HWND; ... fhandle:= FindWindowEx(0, shandle, nil, nil); ...
    (de.comp.lang.delphi.misc)
  • Re: Delphi problem with Laptop
    ... FHandle:= CreateFile( ... raise EComPort.Create(CError_OpenFailed, GetLastError); ...
    (alt.comp.lang.borland-delphi)