|
-
Dec 13th, 2007, 09:41 PM
#5
Thread Starter
PowerPoster
Re: CString into string
I've already test it. Use the namespaces as well. But no luck. Amazing thing is,
Code:
if(m_rtfCtrl.CreateEx(WS_EX_APPWINDOW, WS_BORDER|ES_MULTILINE, CRect(10,10,200,200), &x , 1))
{
CString ss;
CFile rtfFile;
BOOL err = rtfFile.Open("G:\\Work On\\CPP\\RTFControl\\TestFile.rtf", CFile::modeReadWrite, NULL);
int iLength = rtfFile.GetLength();// Data length
char *pBuffer = new char[iLength];// Data buffer
rtfFile.Read(pBuffer, iLength);
CString rtf(pBuffer);
m_rtfCtrl.SetWindowText(rtf);
m_rtfCtrl.GetWindowText(ss);
std::cout << ss << std::endl;
// CString into string
std::string strRTF(ss.GetString());
std::cout << strRTF << std::endl;
}
In my above code, fist cout works fine. The second cout not works.
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
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
|