Delphi-PRAXiS
Seite 3 von 3     123   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Word to PChar (https://www.delphipraxis.net/107246-word-pchar.html)

lbccaleb 24. Jan 2008 19:39

Re: Word to PChar
 
ja klar hier:

Delphi-Quellcode:
type
  TComboBoxItemInfo = record
    DayImage,
    DayPos : integer;
    DateText : pchar;
  end;

lbccaleb 24. Jan 2008 19:41

Re: Word to PChar
 
Zitat:

Zitat von Remko
Maybe I don't understand the question right because of my bad German Language knowledge but it seems to me you want to display a systemtime as string? Why not use SystemTimeToDateTime and use format?

because i compile without the needed units..

SirThornberry 24. Jan 2008 19:42

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.

lbccaleb 24. Jan 2008 19:46

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:
systemtime.wday + 1;
nicht!! gibs noch ne möglichkeit???

Remko 24. Jan 2008 19:50

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).

lbccaleb 24. Jan 2008 20:00

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..

Remko 24. Jan 2008 20:03

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;

lbccaleb 24. Jan 2008 20:12

Re: Word to PChar
 
Zitat:

Zitat von Remko
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).

is jwawinsta a single unit?? wehre can i find this??

Remko 24. Jan 2008 20:14

Re: Word to PChar
 
It's part of the Jedi Apilib.


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:10 Uhr.
Seite 3 von 3     123   

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