Re: ERROR_RESOURCE_TYPE_NOT_FOUND error comes
- From: "Eddie Pazz" <drpazz@xxxxxxxxxxx>
- Date: Thu, 14 Feb 2008 06:48:43 -0800
kkagarwal2002@xxxxxxxxx> wrote in message news:27c62fd1-015c-466b-be44-c1ff11ead814@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 14 Feb, 16:28, "David Ching" <d...@xxxxxxxxxxxxxxxxxxxxxx> wrote:<kkagarwal2...@xxxxxxxxx> wrote in message
news:1e81f75d-c129-4b3f-890c-bb537bda24e4@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hello Everybody,
> I am unable to load the bitmap image in CListCtrl control. I made
> application as follows:
> 1. Made DLL which contains resources like dialog, bitmap etc. by
> having the multiple .rc files in a project.
> 2. Made a static lib project which contains classes for resources
> which are in DLL. This lib is also having a dependency of DLL.
> 3. Made a 2 Exes which load that lib. It has a dialog which contains
> CListCtrl. This control is populated by lib classes.
> I am using VS2003. I am getting surprised result when i run two exes.
> one exe shows bitmap in CListCtrl but other does not. I am loading the
> bitmap in one of the class of static lib using LoadBitmap but it
> returns 0 and when i tried to get error code, it gives 1813.
> Can anybody help me on this issue?
> Thanks in advance.
> Kamal
Error 1813 is, "The specified resource type cannot be found in the image
file. "
It sounds like the wrong resource handle is being used. This is controlled
somewhat by MFC at startup, which looks for a DLL named with the current
locale ID, and if not found, is defaulted to the app .exe itself. If you
want to control it yourself, call AfxSetResourceHandle() at a convenient
place, normally CWinApp::InitInstance() (actually, this method in your
derived class).
-- David- Hide quoted text -
- Show quoted text -
Hello David,
Thanks for prompt reply. Actually My exe also has resources and my DLL
also has resources so when i will do AfxSetResourceHandle from Exe to
DLL then my exe resource will not be used. I want to escape from that
situation.
Do you have any other alternative approach?
Is your DLL a resource-only DLL? If so, you have to use AfxSetResourceHandle. If you also want to use the resources in your exe, you have to add the DLL to the MFC resource chain. To solve this, I added a function to the dll that I explicitly call from my exe so MFC loads it and adds it to the chain.
.
- Follow-Ups:
- Re: ERROR_RESOURCE_TYPE_NOT_FOUND error comes
- From: Joseph M . Newcomer
- Re: ERROR_RESOURCE_TYPE_NOT_FOUND error comes
- References:
- ERROR_RESOURCE_TYPE_NOT_FOUND error comes
- From: kkagarwal2002
- Re: ERROR_RESOURCE_TYPE_NOT_FOUND error comes
- From: David Ching
- Re: ERROR_RESOURCE_TYPE_NOT_FOUND error comes
- From: kkagarwal2002
- ERROR_RESOURCE_TYPE_NOT_FOUND error comes
- Prev by Date: CDocTemplate::OpenDocumentFile(, FALSE)
- Next by Date: Database corruption.
- Previous by thread: Re: ERROR_RESOURCE_TYPE_NOT_FOUND error comes
- Next by thread: Re: ERROR_RESOURCE_TYPE_NOT_FOUND error comes
- Index(es):
Relevant Pages
|