Original Indy 10.2.0.3 IdWinsock2.Pas
function FixupStub(hDll: THandle; const AName: string): Pointer;
{$IFDEF USEINLINE}inline;{$ENDIF}
begin
if hDll = 0 then begin
raise EIdWinsockStubError.Build(WSANOTINITIALISED, RSWinsockCallError, [AName]);
end;
Result := Windows.GetProcAddress(hDll, {$IFDEF WINCE}PWideChar {$ELSE}PChar {$ENDIF}(AName));
if Result = nil then begin
raise EIdWinsockStubError.Build(WSAEINVAL, RSWinsockCallError, [AName]);
end;
end;
Change It
function FixupStub(hDll: THandle; const AName: string): Pointer;
{$IFDEF USEINLINE}inline;{$ENDIF}
{$IFDEF WINCE}
Var
S: Array[0..512] Of WideChar;
{$ENDIF}
begin
if hDll = 0 then begin
raise EIdWinsockStubError.Build(WSANOTINITIALISED, RSWinsockCallError, [AName]);
end;
{$IFDEF WINCE}
StringToWideChar(AName, S, Length(AName) + 1);
Result := Windows.GetProcAddress(hDll, S);
{$ELSE}
Result := Windows.GetProcAddress(hDll, PChar(AName));
{$ENDIF}
if Result = nil then begin
raise EIdWinsockStubError.Build(WSAEINVAL, RSWinsockCallError, [AName]);
end;
end;
I Think Lazarus For WinCE not convert (using cast) String to WideChar because result is AName is not correct in original code
But IdTCPClient do not connect
I'm working