I have some ID in MFC application, e.g.:
#define IDC_BUTTON1 1002
And I have some functions in APP, using this ID, e.g.:
GetDlgItem(IDC_BUTTON1)->SetWindowPos(NULL,cx-750,cy-100,90,40,NULL);
Can I convert CString, like "IDC_BUTTON1" to use it dynamically? I want to do something like this:
GetDlgItem(_converted_string_)->SetWindowPos(NULL,cx-750,cy-100,90,40,NULL);
Conversion (atoi or smth.) from "1002" is not a variant.
IDC_BUTTON1is a symbol, that exists during compilation only. Once the final executable image is generated, there are no traces left behind. So no, there is no way to do what you're asking for. Why would you need that? What is your specific scenario? - IInspectableCStringwith the value of a compile-time constant be useful? What problem are you trying to solve? - IInspectableif (field_name=="fieldname"), get a good book on writing C++ code. That's an anti-pattern right there. - IInspectable