From: emcz on 19 Apr 2010 18:24 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 20 Apr 2010 00:23 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().
|
Pages: 1 Prev: Redistribute mfc90.dll and msvcr90.dll Next: Two resource files having same identifier value |