> It's not a complete wrapper. Did you even look at the sources? :roll:
Of course I did. Don't roll your eyes at me.
> Progi's wrapper utilises the import library to access the functions
And that's what I want to avoid. I don't want to use both the DLL and LIB files to make it work, and neither do I want to use IncludeFiles like the examples do. Just the DLL. It makes for a good learning experience, since I need to know how to use other DLLs too that don't have LIB files with them. Importing and all that jazz is too much, and that is what the wrapper does (proof: remove the LIB file and the samples don't work anymore). I've looked at the sources so I know that to be true.
I thought PureBasic could just use OpenLibrary to access a DLL, and then use CallFunction to use the DLL's commands. Tell me I'm wrong. Therefore, how would I do that with FreeImage.dll alone?
Just to show that I've been trying and am not asking for a total handout of help, here's my work so far:
Code: Select all
Enumeration -1
#FIF_UNKNOWN
#FIF_BMP
#FIF_ICO
#FIF_JPEG
#FIF_JNG
#FIF_KOALA
#FIF_LBM
#FIF_MNG
#FIF_PBM
#FIF_PBMRAW
#FIF_PCD
#FIF_PCX
#FIF_PGM
#FIF_PGMRAW
#FIF_PNG
#FIF_PPM
#FIF_PPMRAW
#FIF_RAS
#FIF_TARGA
#FIF_TIFF
#FIF_WBMP
#FIF_PSD
#FIF_CUT
#FIF_XBM
#FIF_XPM
#FIF_DDS
#FIF_GIF
#FIF_HDR
#FIF_FAXG
#FIF_SGI
#FIF_EXR
#FIF_J2K
#FIF_JP2
EndEnumeration
#FIF_IFF = #FIF_LBM
lib=OpenLibrary(#PB_Any,"FreeImage.dll")
If lib And OpenWindow(0,200,200,640,480,"FreeImage DLL test",#PB_Window_SystemMenu)
ImageGadget(0,10,10,600,400,0,#PB_Image_Border)
CallFunction(lib,"_FreeImage_Initialise@4") ; Works.
CallFunction(lib,"_FreeImage_Load@12",#FIF_GIF,"Waterfall.gif") ; Fails.
Repeat
ev=WaitWindowEvent()
Until ev=#PB_Event_CloseWindow
EndIf
When I run this, I get a "Number expected instead of string" error, but I don't know why. The manual seems to imply that I'm passing the correct data types for the CallFunction line, so I'm stumped.