Incompatible types: 'WideChar' and

0

Przy kompilowaniu komponentu z neta ;/

function NS_StrLCat(Dest: PWideChar; const Source: PWideChar; maxLen: Cardinal): PWideChar;
var
  D, S: PWideChar;
  last: PWideChar;
begin
  D := Dest + StrLen(Dest);
  S := Source;
  last := Dest + maxLen - 1;
  while (S^ <> #0) and (D < last) do
  begin
    D ^ := S^;
    Inc(D);
    Inc(S);
  end;
  D^ := #0;
  Result := Dest;
end;

w tej linijce:

  D := Dest + StrLen(Dest);

Jak pozbć sie/zignorować błąd ?

0

Nie znam się za bardzo na używaniu PWideCharów, ale po zmianie na D := Dest + Length(Dest);
ten kod co podałeś się kompiluje, ale nie wiem czy działa jak należy ;/ Najlepiej sprawdź samemu.

0

Dest jest wskaźnikiem to nie wiem, czy to tak może być.
Ja bym to raczej rzutowała: StrLen(PChar(Dest))

1 użytkowników online, w tym zalogowanych: 0, gości: 1