I have a custom little CString formatter which lets you insert variables into a CString. It works as follows:
you have a reference to a main string on a seperate string table, and then secondary CStrings which are string representations of variables and fit in the first CString in order. eg:
if:
sMainString = "I have three %1 and two %2"
sString 1 = "apples"
sString 2 = "oranges"
i can write:
CString = construct::makeString(sMainString, sString1, sString2);
and CString will become:
Cstring = "I have three apples and two oranges"
Now, my problem is that the variables after the comma MUST be CStrings.
If I have:
sMainString = "The letter '%1' is the letter you have chosen in %2"
int iChoice = 4
sWord = "people"
In this case, instead of 2 CStrings, i have a CString called sWord which lets say has a value of "people", sWord is turned into a char * array so i can find the 4th (iChoice) letter.
I now have:
CString = construct::makeString(sMainString, sWord(iChoice), (const char *)sWord);
how do I convert sWord(iChoice) and (const char *)sWord into CStrings?
(No i can't use CString.Format because the first string is a reference on a string table and it won't work)