From: emcz on
Does any encounter this problem in your own dll which statically
links to MFC, AfxFindResourceHandle is defined as AfxGetResourceHandle
and it returns NULL, when the dll dynamically links to MFC,
AfxFindResourceHandle can return a valid handle?

Is there any solution for this problem?

I found some old posts about this problem, but I didn't see any
solution. Some post suggested calling AfxSetResourceHandle, I tried
but it didn't help.

TIA for any help.
From: Faisal on
On Apr 20, 3:24 am, emcz <emcz1...(a)yahoo.com> wrote:
> Does any encounter this problem in your own dll which statically
> links to MFC, AfxFindResourceHandle is defined as AfxGetResourceHandle
> and it returns NULL, when the dll dynamically links to MFC,
> AfxFindResourceHandle can return a valid handle?
>
> Is there any solution for this problem?
>
> I found some old posts about this problem, but I didn't see any
> solution. Some post suggested calling AfxSetResourceHandle, I tried
> but it didn't help.
>
> TIA for any help.

This is expected behavior. When dynamically linked to MFC,
AfxFindResourceHandle() have to go through all extension dlls to
locate the resource. In static linking there is no need for it.

In your case, where does the resource lie? In the ocx or a separate
resource dll. If it is in a separate resource dll, you would have to
explicitly the set the resource handle by calling
AfxSetResourceHandle().