FIX: AFX_IDC_MAGNIFY Cursor Fails to Load from AFXDLL

Last reviewed: September 18, 1997
Article ID: Q113532
1.00 WINDOWS kbprg kbfixlist kbbuglist

The information in this article applies to:

  • The Microsoft Foundation Classes (MFC), included with:

        - Microsoft Visual C++ for Windows, version 1.0
    

SYMPTOMS

When using the File Print Preview capabilities of the Microsoft Foundation Classes (MFC), the mouse cursor disappears when dragged over a view when the application is in Print Preview mode. This behavior occurs only when the AFX_IDC_MAGNIFY cursor resource is moved from the application to an extension (_AFXDLL) DLL.

CAUSE

The problem occurs in the CPreviewView::OnSetCursor() function. Line 904 of the VIEWPREV.CPP file, below

   m_hMagnifyCursor = ::LoadCursor(AfxGetInstanceHandle(),
                                   MAKEINTRESOURCE(AFX_IDC_MAGNIFY));

should be

   m_hMagnifyCursor = ::LoadCursor(AfxGetResourceHandle(),
                                   MAKEINTRESOURCE(AFX_IDC_MAGNIFY));

STATUS

Microsoft has confirmed this to be a problem in the Microsoft Foundation Classes for Windows version 2.0. This problem was corrected in the Microsoft Foundation Classes version 2.5.

MORE INFORMATION

AfxGetInstanceHandle() always returns the HINSTANCE of the application. AfxGetResourceHandle() first checks the application for the resource; if it isn't found, AfxGetResourceHandle() walks through each of the extension dynamic-link libraries (DLLs) to find the resource. For additional information concerning AfxGetResourceHandle(), please consult the Microsoft Foundation Classes Technical Note #33.


Additional reference words: 1.00 2.00 magnify print preview technote tech
note
KBCategory: kbprg kbfixlist kbbuglist
KBSubcategory: MfcDLL
Keywords : kb16bitonly MfcDLL kbbuglist kbfixlist kbprg
Technology : kbMfc
Version : 1.00
Platform : WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.