Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi String nach PWChar (https://www.delphipraxis.net/4780-string-nach-pwchar.html)

Salomon 11. Mai 2003 20:05


String nach PWChar
 
Hallo,
wie kann ich einen String in einen PWChar umwandeln? Ich habe das ganze mit PWChar(String) gemacht. Das läst sich auch compelieren, allerdings bekomme ich die Warnung:
[Warning] Unit3.pas(144): Suspicious typecast of String to PWideChar

Da hat der Kompiler wohl recht, denn die Funktion in der ich den PWChar brauche funktioniert nicht. Wie kann ich also noch einen String in PWChar umwandeln :?:

Thx Salomon

sakura 11. Mai 2003 20:12

Einfach mit
Code:
PWChar(WideString(string));
...:cat:...

Salomon 11. Mai 2003 20:17

Jepp, das klappt. Danke.

Dezipaitor 11. Mai 2003 21:29

muss ich eine solche PCHAR variable vorher reserviert haben?


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:43 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz