Powerbasic Museum 2020-B

IT-Consultant: Patrice Terrier => Discussion => Topic started by: Patrice Terrier on March 10, 2013, 09:55:56 AM

Title: Light in the tunnel
Post by: Patrice Terrier on March 10, 2013, 09:55:56 AM
It is coming slowly...in the long process of converting my graphic librairies to C/C++.

I have even written my own GDIPLUS flat API encapsulation, to ease the conversion between the different languages i am using.

Example of code that is working well in both 32/64-bit (and faster/smaller than the OOP encapsulation)

long GdipLoadImageFromFile (IN wstring sImgName, OUT LONG_PTR &lpImg) {
    long nRet = -1; // Error
    if (g_GDIPLIB) {
        long_proc (WCHAR*, LONG_PTR*);
        zProc hProc = (zProc) GetProcAddress(g_GDIPLIB, "GdipLoadImageFromFile");
        if (hProc) { nRet = hProc((WCHAR*)sImgName.c_str(), &lpImg); }
    }
    return nRet;
}