Thema: C++ IntToStr zu WCHAR

Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#18

AW: IntToStr zu WCHAR

  Alt 5. Aug 2017, 08:44
So geht's aber auch wieder so viele Zeilen
Inklusive kleinen Helfern.

Code:
#define long_proc_c typedef long (__cdecl *Proc)
Code:
HMODULE MSVCRT() {
    static HMODULE hModule;
    if (hModule == 0) { hModule = LoadLibrary(L"MSVCRT"); }
    return hModule;
}
Code:
long Add_Str(OUT WCHAR* dest, IN WCHAR* srce) {
    long nRet = -1; // Error
    HMODULE hModule = MSVCRT();
    if (hModule) {
        long_proc_c(WCHAR*, WCHAR*, size_t);
        Proc hProc = (Proc)GetProcAddress(hModule, "wcsncat");
        if (hProc) { nRet = hProc(dest, srce, _TRUNCATE); }
    }
    return nRet;
}
Code:
       
Add_Str(VideoInfo, STRL(aMediaProperty.Video_Width));
Add_Str(VideoInfo, L" x ");
Add_Str(VideoInfo, STRL(aMediaProperty.Video_Height));
Add_Str(VideoInfo, L", ");
Add_Str(VideoInfo, STRD(aMediaProperty.Video_FPS));
Add_Str(VideoInfo, L" FPS");
SetWindowText(hLblVideoInfo, VideoInfo);
gruss

Geändert von EWeiss ( 5. Aug 2017 um 08:52 Uhr)
  Mit Zitat antworten Zitat