Discussion:
AfxFindResourceHandle
(too old to reply)
emcz
2010-04-19 22:24:05 UTC
Permalink
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.
Faisal
2010-04-20 04:23:37 UTC
Permalink
Post by emcz
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().

Loading...