Hallo
GetLastError gibt mir 183 ( Cannot create a file when that file already exists. ERROR_ALREADY_EXISTS ) zurück. Woran liegt das?
Delphi-Quellcode:
lDate := ValueStr;
var lDate : String;
lTokens: TStrings;
lSystemTime : TSystemTime;
lBuffer : array[0..64] of Char;
lErrorCode : Integer;
Begin
lTokens := TStringList.Create( );
ExtractStrings( ['.'], [], PChar( ValueStr ), lTokens );
lSystemTime.wDay := StrToInt(lTokens[0]);
lSystemTime.wMonth := StrToInt(lTokens[1]);
lSystemTime.wYear := StrToInt(lTokens[2]);
GetDateFormat( LOCALE_USER_DEFAULT, DATE_SHORTDATE, @lSystemTime, nil, lBuffer, sizeof( lBuffer ) );
lErrorCode := GetLastError();
If( lErrorCode = 0 ) Then lDate := lBuffer;