When i apply this changes to code I still don`t have combinations as I write in the previous message.
Here are the combinations created with new code :
ABCD ABCD BCDE BCDE CDEF CDFE DEFA DEFA
EFAB EFAB FABC FABC ABCD ABCD

I will try to explayin again my problem detailed.
I need to enter two variables (not larger then 20) N and R (N must be larger then R).
for example N=6, R=4.

I create an CString array strArray with N (6) elements
strArray[0] = "A01"
. . . . . . . . . .
. . . . . . . . . .
strArray[5] = "A06"

Now I need to create all combinations with R (4) elements of this array and store them in some new array.