Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi tray hint -> string array problem (https://www.delphipraxis.net/69577-tray-hint-string-array-problem.html)

agm65 17. Mai 2006 11:34


tray hint -> string array problem
 
ich nochmal ;), also ich wollte meinem tray icon nen hint zuweise (string) jetzt bekomme ich das inkompatible typen problem..

Delphi-Quellcode:
IconData.szTip := String

wie kann ich jetzt nochmal nen array in nen string umwandeln bzw nen string in nen array ?

danke für hilfe

marabu 17. Mai 2006 12:06

Re: tray hint -> string array problem
 
Wenn die Namenskonvention mich nicht irre leitet, dann müsste das so funktionieren:

Delphi-Quellcode:
IconData.szTip := PChar(DeinString);
marabu

ManuMF 17. Mai 2006 12:39

Re: tray hint -> string array problem
 
Hallo,

auf jeden Fall funktioniert
Delphi-Quellcode:
StrCopy(IconData.szTip, PChar(String));
Gruß,
ManuMF

Muetze1 17. Mai 2006 13:20

Re: tray hint -> string array problem
 
Und wozu den lästigen TypeCast?

Delphi-Quellcode:
StrPCopy(IconData.szTip, String);
Es gibt doch schliesslich eine passende Funktion!

Zu allen Lösungen hier nochmal der Hinweis auf einen möglichen Buffer-Overflow, da die szTip Eigenschaft längenbegrentzt ist!!!

agm65 17. Mai 2006 13:58

Re: tray hint -> string array problem
 
danke leute das tuts...


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:16 Uhr.

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