JMarsch
JMarsch

Reputation: 21753

Find a control in a resource file

I'm new to c++ and MFC. I am working on a large project, and I need to find the resource definition for a control that is on a form. I am having a very difficult time finding the right resource.

I can identify the control at runtime using spy++, but I have not found anything in the properties that leads me to the correct resource definition. What are some good techniques for tracking down a control in code if I know how to get to it at runtime?

Upvotes: 1

Views: 368

Answers (1)

Serge Z
Serge Z

Reputation: 425

  1. Find ControlID value in "Properties"
  2. translate hexademical value to decimal
  3. search in resource.h file for this value You will see something like #define IDC_YOUR_CONTROL 205

IDC_YOUR_CONTROL is what you need.

Of cause, this solution applicable only for static defined in resource .rc controls. Is controls are created dynamically, you have to investigate source code manually (usually CDialog::OnInitialize() method for MFC dialog)

Upvotes: 2

Related Questions