Sign in to follow this  
Anddos

FindResource fails..

Recommended Posts

I am not sure why this is failing with Error code 1813 is ERROR_RESOURCE_TYPE_NOT_FOUND , "test.dll is in the same directory as the source files and it compiles fine...
#include "stdafx.h"
#include "WinApp.h"
#include <windows.h>

in resource.h there is 
#define ID_DLL                   106
in WinApp.rc there is 
ID_DLL                RC_DATA    "test.dll"
"test.dll" is in the source file directory

#define MAX_LOADSTRING 100
char OutBuffer[64];

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
	HRSRC hResInfo = FindResource(NULL,MAKEINTRESOURCE(ID_DLL),RT_RCDATA);
	if(hResInfo != NULL)
	{
		MessageBox(NULL,"FindResource Loaded","",0);
	}
	else
	{
		wsprintf(OutBuffer,"%s %d\n","FindResource Failed",GetLastError());
		MessageBox(NULL,OutBuffer,"",0);
	}
	return 0;
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this