macro name in loop

I have macros (control names) like IDC_T_UCLASS1, IDC_T_UCLASS2, IDC_T_UCLASS3 etc. How to shorten the command in a loop so I could concatenate base name of macro with its number?

1
2
3
LCombo_Fill(dialog, IDC_T_UCLASS + 1, esdata.unitgroups.head(), L"All");
LCombo_Fill(dialog, IDC_T_UCLASS + 2, esdata.unitgroups.head(), L"All");
LCombo_Fill(dialog, IDC_T_UCLASS + 3, esdata.unitgroups.head(), L"All");


I know this is not correct syntax. Is some shortcut for this or do I must create buffer name and strcpy to join two strings?
The C preprocessor is not Turing-complete. It doesn't allow iteration. Consider using an interpreted language to generate repetitive code into a .inl file to be included from your other sources.
Topic archived. No new replies allowed.