LoadIcon()/LoadImage() fails with error code 0x00000715

-4

I am trying to load an icon in my Windows taskbar DeskBand but it always fails with error code 0x00000715(The specified resource type cannot be found in the image file). I have already included the resource.h file and it contains the id for the ICON. Here is the code i use to load the icon.

m_hIcon = (HICON)LoadImage(m_hInst, MAKEINTRESOURCE(IDI_ICON_1), 
                                  IMAGE_ICON, 32, 32, LR_SHARED);
if (m_hIcon )
{
ATLTRACE(_T("Icon loaded successfully"));
}
else
{

ATLTRACE(_T("Couldnot load icon %x"),GetLastError());
}

I have also tried the loading the ICON with LoadIcon() function but it also fails with the same error.

LoadIcon(m_hInst, MAKEINTRESOURCE(IDI_ICON_1));

EDIT: I used the ATL Project template to create the dll.

c++
winapi
visual-c++
asked on Stack Overflow Dec 17, 2014 by thunderbird • edited Dec 17, 2014 by thunderbird

1 Answer

1

That error code is ERROR_RESOURCE_TYPE_NOT_FOUND which is described as so:

The specified resource type cannot be found in the image file.

That is pretty unequivocal. The module identified by that module handle has no icon resource with that resource name and type. Either you are passing the wrong module handle, or you failed to link the icon resource.

answered on Stack Overflow Dec 17, 2014 by David Heffernan • edited Dec 17, 2014 by David Heffernan

User contributions licensed under CC BY-SA 3.0