How to user CString.Format with CString?

I have a two CString var with using MFC.
CString a = "abc";
CString b = "def";

And int c = 5;

I want to display "abc05def".

However, this code blow doesn't work.

a.Format("%s%02d%s", a, b, c)
and
a.Format("%s%02d%s", a.GetBuffer(0), b.GetBuffer(0), c)

Anyone know how??
I forgot to cast (LPCTSTR). : P
1
2
CString strC;
strC.Format("%s%02d%s", a, b, c);

you need a new CString var
Topic archived. No new replies allowed.