-
December 7th, 2011, 12:12 AM
#1
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
-
December 7th, 2011, 12:57 AM
#2
Re: CString Formatting Problem in MFC
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));
Best regards,
Igor
-
December 7th, 2011, 01:28 AM
#3
Re: CString Formatting Problem in MFC
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|