Why Do I Get an Incorrect Resource ID String from the CNiNumEdit Measurement Studio Control? Primary Software: Measurement Studio>>Visual C++ SupportPrimary Software Version: 8.1 Primary Software Fixed Version: 8.1 Secondary Software: N/A
Problem: Using Microsoft Foundation Class (MFC) libraries, control resource IDs may be obtained using the CWnd::GetDlgCtrlID() method.
CWnd *pWnd = GetFocus();
However, using this method to obtain the resource ID from the Measurement Studio CNiNumEdit control returns an invalid resource ID. How do I get the correct resource ID? Solution: The CNiNumEdit control is actually composed of multiple controls. When the focus is on the CNiNumEdit control, it is really focused on the EditBox control of the CNiNumEdit control. To obtain the resource ID for the entire CNiNumEdit control, query the parent control.
CWnd *pWnd = GetFocus();
In this approach, the user cannot have a single handler for all controls. There must be two handlers. The handlers can call a common funtion after getting the control ID.
//for CniNumEdit controlo
Refer to the Related Links section for more information. Related Links: KnowledgeBase 126GIBh0: How Do I Create Controls Dynamically in Microsoft Visual C++ When Using MFC without the Demo Mode Message Window? Attachments:
Report Date: 10/27/2006 Last Updated: 04/10/2007 Document ID: 3XU8IQNX |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
