The information in this article applies to:
SYMPTOMSAfxFindResourceHandle() fails when searching for icon (RT_ICON), cursor (RT_CURSOR), and string resources (RT_STRING). CAUSEThis occurs because of how the Windows API function FindResource, which is called by AfxFindResourceHandle(), is designed. RESOLUTION
For icons and cursors, use the RT_GROUP_ICON or RT_GROUP_CURSOR resource
type with AfxFindResourceHandle() to return the EXE or DLL instance where
the resource is located, and then call ::LoadIcon() or ::LoadCursor() to
load the resource. STATUSThis behavior is by design. MORE INFORMATIONAfxFindResourceHandle is an _AFXDLL-specific API for walking the resource list to look for a given match. It takes the name and type of a resource and returns the resource handle where it was first found (or NULL). It is documented in MFC Technote TN033: DLL Version of MFC. Sample CodeThe following sample code shows successful uses of RT_GROUP_ICON and RT_GROUP_CURSOR:
Additional query words: 2.5 2.50 2.51 2.52 3.0 3.00 3.1 3.10 3.2 3.20 AfxFindResourceHandle FindResource
Keywords : kbcode kbnokeyword kbDLL kbMFC kbVC |
Last Reviewed: August 3, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |