![]() |
Re: Word to PChar
ja klar hier:
Delphi-Quellcode:
type
TComboBoxItemInfo = record DayImage, DayPos : integer; DateText : pchar; end; |
Re: Word to PChar
Zitat:
|
Re: Word to PChar
Und warum hast du DateText als PChar definiert?
Willst du über dll-grenzen hinweg arbeiten? Wenn dem nicht so ist wäre es das einfachste du definierst DateText als String. |
Re: Word to PChar
hmm stimmt eigentlich mal sehen....
ok danke das geht schon mal, nun muss ich eigentlich nur noch wissen wie ich mit systemtime herrausfinde welcher wochentag ist, denn leider gehtest mit
Delphi-Quellcode:
nicht!! gibs noch ne möglichkeit???
systemtime.wday + 1;
|
Re: Word to PChar
I also defined DateTimeString function in JwaWinsta this is an api from utildll that (well the name says it all). It also takes care of localisation for you (it takes a filetime as input).
|
Re: Word to PChar
yes, but i must use the units sysutils, math and types to compile the prog. i want without these units to get a small filesize.. i should be all nonvcl..
|
Re: Word to PChar
You don't need all that, it's all winapi:
// This is the version for NT Terminal Server, 2000, XP/2003 and Server 2008 function DateTimeString(DateTime: PFILETIME; lpBuffer: PWideChar): PWideChar; stdcall; // This is a wrapped for all OS versions function DateTimeStringSafe(DateTime: PFILETIME; lpBuffer: PWideChar; cchDest: SIZE_T): PWideChar; stdcall; // This is the Vista version which takes an additional parameter with // maximum buffer size (you have to set it) function DateTimeStringVista(DateTime: PFILETIME; lpBuffer: PWideChar; cchDest: SIZE_T): PWideChar; stdcall; function DateTimeString; external utildll name 'DateTimeString'; function DateTimeStringVista; external utildll name 'DateTimeString'; function DateTimeStringSafe(DateTime: PFILETIME; lpBuffer: PWideChar; cchDest: SIZE_T): PWideChar; stdcall; begin // Zero Memory ZeroMemory(lpBuffer, cchDest * SizeOf(WCHAR)); // Are we running Vista? if IsVista then begin // Vista version Result := DateTimeStringVista(DateTime, lpBuffer, cchDest); end else begin // Other OS's (including server 2008!) Result := DateTimeString(DateTime, lpBuffer); end; end; |
Re: Word to PChar
Zitat:
|
Re: Word to PChar
It's part of the Jedi Apilib.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:10 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