Thema: C++ IntToStr zu WCHAR

Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#9

AW: IntToStr zu WCHAR

  Alt 4. Aug 2017, 23:13
So macht man aus einer Zeile 11

Delphi-Quellcode:
        INT64 Second = (aMediaProperty.PlaybackLength / 10000) / 1000;
        
        WCHAR Minutes[MAX_PATH];
        WCHAR Seconds[MAX_PATH];
        WCHAR StreamLenght[MAX_PATH];
        // Minuten
        std::wstring Min_tmp = std::to_wstring(Second / 60);
        WCHAR * Min = &Min_tmp[0];
        Str_Combine(Minutes, Min, L" Min ");
        // Sekunden
        std::wstring Sec_tmp = std::to_wstring(Second %= 60);
        WCHAR * Sec = &Sec_tmp[0];
        Str_Combine(Seconds, Sec, L" Sec");
        // Kombinieren
        Str_Combine(StreamLenght, Minutes, Seconds);
        // Ausgabe
        SetWindowText(hLblStreamLenght, StreamLenght);
Was für ein Schmarrn. Eine andere Lösung fällt mir nicht ein.
Wenn ich das jetzt hiermit auch noch machen muss dann habe ich 50 Zeilen anstelle von 3

Delphi-Quellcode:
        //lbl_VideoInfo.Caption : = FormatFloat('#,##0', aMediaProperty.Video_Width) + ' x ' +
        // FormatFloat('#,##0', aMediaProperty.Video_Height) + ', ' +
        // FormatFloat('##0.00', aMediaProperty.Video_FPS) + ' FPS';
        //SetWindowText(hlblVideoInfo, VideoInfo);
        //lbl_AudioProperty.Caption : = intToStr(aMediaProperty.Audio_Channels) + ' Channel, ' +
        // FormatFloat('#,##0', aMediaProperty.Audio_Samplerate) + ' SPS, ' +
        // intToStr(aMediaProperty.Audio_BitsPerSample) + ' BPS';
        //SetWindowText(hlblAudioProperty, AudioProperty);
gruss

Geändert von EWeiss ( 4. Aug 2017 um 23:21 Uhr)
  Mit Zitat antworten Zitat