CString Formatting Problem in MFC
Hi,
Cant We Format a CString Variable in MFC Twice.
Iam Getting Assertion in Following COde.
CString sAppFile;
sAppFile.Format("%s.dat", "E:\\VSS");
sAppFile.Format(" IN-[%s] ", sAppFile);
Iam Getting Assertion while running the code,Can ANyone Plz help me on this to understand.
If I Continue after assertion Iam Getting Like below in Variable Window
sAppFile = IN-[ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ]
Thanks
Abhi
Re: CString Formatting Problem in MFC
Quote:
Code:
sAppFile.Format(" IN-[%s] ", sAppFile);
You can't use a string in formatting itself. You need to create a temporary string object instead:
Code:
sAppFile.Format(" IN-[%s] ", CString(sAppFile));
Re: CString Formatting Problem in MFC