The project compiles and links fine, no warnings, no errors. When the program runs, the function FindResource() returns a null pointer, i.e. it can't find the specified resource.
DarkGDK version - doesn't work
void DarkGDK(void)
{
HRSRC hRsrc;
hRsrc = FindResource(GetModuleHandle(0), MAKEINTRESOURCE(IDB_BOTTOM),"PNG");
if (!hRsrc)
MessageBox(NULL,"Can't find resource!","Error",MB_OK);
while(LoopGDK())
{
gameLoop();
dbSync();
}
}
Win32 version - works
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
MSG msg;
HACCEL hAccelTable;
HRSRC hRsrc;
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_EMPTYAPP, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
return FALSE;
hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_EMPTYAPP));
hRsrc = FindResource(GetModuleHandle(0), MAKEINTRESOURCE(IDB_BOTTOM),"PNG");
if (!hRsrc)
MessageBox(NULL,"Can't find resource!","Error",MB_OK);
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
EDIT: In an earlier post I was enquiring about the usage of 3 apparently new functions, DarkGDKStart, DarkGDKInit and DarkGDKEnd. Well I've searched the library files and can't find any reference to them, when I try to compile with them I get a linker error, symbols not found.
Of all the things I've lost .. I miss my marbles most of all.