edward95
asked on
Right alignment in CString::Format
I want to use CString::Format to pack the items and then print it out. The items are not fix in length.
For example:
CString str, item1, item2;
int i;
for (i= 0 ; i<50 ; i++)
{
...
...
str.Format("%6s %15s", item1, item2);
pDC->TextOut(point.x, point.y, str);
...
}
item1 and item2 will change and have different length all the time.
How can I make the items to right alignment in CString::Format?
For example:
CString str, item1, item2;
int i;
for (i= 0 ; i<50 ; i++)
{
...
...
str.Format("%6s %15s", item1, item2);
pDC->TextOut(point.x, point.y, str);
...
}
item1 and item2 will change and have different length all the time.
How can I make the items to right alignment in CString::Format?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.