Hello all,
I'm still porting hat old application and I can see things that should be improved.
As an example, I'm hardcoding the DoDataExchange function with specific hardcoded resource symbols to make the DDX assignments.
I can create an array using dynamic memory allocation easily, but what I do not know is how to make the assignment between what I've just created and the Resource symbol name.
i.e.:
DDX_Control(pDX, IDC_STATIC_R5, m_cstatR5);
DDX_Control(pDX, IDC_STATIC_R4, m_cstatR4);
DDX_Control(pDX, IDC_STATIC_R3, m_cstatR3);
DDX_Control(pDX, IDC_STATIC_R2, m_cstatR2);
DDX_Control(pDX, IDC_STATIC_R1, m_cstatR1);
Here you can see how I'm making some associations.
I would like to use something like:
CString csName = "";
for (i=0;i<100;i++)
{
csName.Format("m_cstatR%i",i);
DDX_Control(pDX, IDC_STATIC_R1+i, csName);
}
Now... how can I create the IDC_STATIC_Rx dynamically without worrying for the existing ones?
I'm worried about what could happen if two resource identifiers would become equal.
I've tried to google for it, but my google fu is not as good as it should... clearly as my VC++ skills which are a little bit rusty...
Thank you in advance!