• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

Light in the tunnel

Started by Patrice Terrier, March 10, 2013, 09:55:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Patrice Terrier

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;
}
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com