BUG: BLOCKS32 Sample Fails to Show Cursors when Linked to MFC

Article translations Article translations
Article ID: 208856 - View products that this article applies to.
This article was previously published under Q208856
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

On This Page

SYMPTOMS

Typically, when you move the mouse pointerover a rectangle or an ellipse that is inserted in the BLOCKS32 sample, a different mouse cursor appears depending on the position of the mouse.

However, if you compile the BLOCKS32 sample with the Use MFC in a Static Library option, the different cursors do not appear when you move the mouse pointer over a rectangle or an ellipse.

CAUSE

When an application is linked to MFC by using the static library, the MFC resources are compiled into the executable of an application. The executable of the application will include the Afxres.rc file. To check this, click Resource Includes on the View menu. The Afxres.rc file has the resources that CRectTracker uses in the MFC source code.

These resources are only included when _AFX_NO_TRACKER_RESOURCES is not defined. The BLOCKS32 project has _AFX_NO_TRACKER_RESOURCES defined. Therefore, it does not put the resources that CRectTracker requires in the executable image of the application. Therefore, none of the cursors that are used by CRectTracker will show up when you build the sample by using MFC statically.

RESOLUTION

  1. On the View menu, click Resource Includes.
  2. Delete the following line:
       #define _AFX_NO_TRACKER_RESOURCES 
    				

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Extract the Blocks32.exe sample from the MSDN, the Microsoft Developers Network.
  2. On the Project menu, click Settings.
  3. Change Use MFC in a Shared DLL to Use MFC in a Static Library.
  4. Build and then run the application.
  5. From the New menu, click Rectangle.
  6. Notice that when you move the mouse pointer into the rectangle, the cursor disappears.
View the Afxres.rc file as a text file and you will see that CRectTracker resources are only included when _AFX_NO_TRACKER_RESOURCES is not defined.

Properties

Article ID: 208856 - Last Review: February 21, 2014 - Revision: 2.0
APPLIES TO
  • Microsoft Visual C++ 5.0 Enterprise Edition
  • Microsoft Visual C++ 6.0 Enterprise Edition
  • Microsoft Visual C++ 5.0 Professional Edition
  • Microsoft Visual C++ 6.0 Professional Edition
  • Microsoft Visual C++, 32-bit Learning Edition 6.0
Keywords: 
kbnosurvey kbarchive kbbug kbnofix kbcontainer kbcursor KB208856

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com