|
-
Feb 21st, 2002, 12:43 PM
#1
Thread Starter
Hyperactive Member
argh!!!
can anyone tell me what i'm doing wrong here....
i've been looking at this for too long
Code:
CString strItem = "";
int j = 0;
char* pFileName = _T("Points.dat");
CFile file( pFileName, CFile::modeCreate | CFile::modeWrite );
// Write data to file
// Format:
// Point [TAB] Type [TAB] Selector [TAB] Delta [TAB] Commit \r\n
// ...
int nListCount = m_PointsList.GetItemCount();
for(int i = 0; i < nListCount; i++)
{
for(j = 0; j < 5; j++)
{
strItem = m_PointsList.GetItemText( i, j ) + "\t";
UINT nLen = (UINT) strItem.GetLength();
char* pBuf = new char[nLen + 1];
pBuf = strItem.GetBuffer( nLen + 1 );
file.Write(pBuf, sizeof(pBuf));
delete[] pBuf;
strItem.ReleaseBuffer( nLen + 1 );
}
}
file.Close();
it keeps crashing when it tries to delete[] pBuf
any ideas?
Bababooey
Tatatoothy
Mamamonkey
-
Feb 21st, 2002, 01:15 PM
#2
Thread Starter
Hyperactive Member
der!!!
nm, figured it out
Code:
char* pBuf;
pBuf = strItem.GetBuffer( nLen );
file.Write(pBuf, nLen);
strItem.ReleaseBuffer( nLen );
Bababooey
Tatatoothy
Mamamonkey
-
Feb 22nd, 2002, 09:39 AM
#3
Thread Starter
Hyperactive Member
Bababooey
Tatatoothy
Mamamonkey
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
|