I'm a student trying to teach myself C. I know the basics of it and now I would like to write a simple DLL using the WinAPI so I can use it in another BASIC-like language.
I'm using CodeBlocks with the compiler it comes with (since I can't afford to invest in any other compilers/IDEs at this point)
Basically, what I'm trying to do is kind of wrap the PlgBlt Function (here is what I have so far):
#include <windows.h>
BOOL WINAPI __declspec(dllexport) LibMain (HINSTANCE hInst, DWORD Reason, LPVOID Reserved)
{
if(Reason==DLL_PROCESS_ATTACH)
{
return TRUE;
}
if(Reason==DLL_PROCESS_DETACH)
{
return TRUE;
}
return FALSE;
}
BOOL __declspec(dllexport) __stdcall Blit (HDC dest, HDC image, HBITMAP mask, int width, int height, int pointA, int pointB, int pointC)
{
POINT points[] = {pointA, pointB, pointC};
BOOL blitResult = PlgBlt(dest, points, image, 0, 0, width, height, mask, 0, 0);
return blitResult;
}
But it says that I'm trying to reference an undefined reference to PlgBlt. From what I read at MSDN (here) the PlgBlt function should be available to me since I've included windows.h.
I'm still quite new to all of this, so if there are any other errors in there throwing it off, please let me know!
Any help would be much appreciated!