Microsoft Visual Studio 2005长短字符和字符串有关问题

Microsoft Visual Studio 2005长短字符和字符串问题
我写了如下代码想要实现在listctrl里面显示但是遇到问题请高手指教
void   CAdsBkDlg::OnShowWindow(BOOL   bShow,   UINT   nStatus)
{
CDialog::OnShowWindow(bShow,   nStatus);

CFile m_File;  
CFileException   e;
ULONGLONG   dwLength;
addresslist.InsertColumn(0,_T( "名前 "),LVCFMT_LEFT,   60);
addresslist.InsertColumn(1,_T( "IP "),LVCFMT_LEFT,160);
BOOL   bopened   =   m_File.Open(_T( "e:\\adsbook.txt "),CFile::modeRead,&e);
dwLength=m_File.GetLength();
if(!bopened)
{
MessageBox(_T   ( "FILE   CAN 'T   OPEN! "),_T   ( "Error "),MB_OK);
return;
}
else
{    
TCHAR   *pbuf;      
int   *size;
int   i=0;
int   lin=0;
int   row=0;
pbuf=(TCHAR       *)malloc(dwLength);  
TCHAR   puf[100][20];    
m_File.SeekToBegin();
m_File.Read(pbuf,   dwLength);


TCHAR   seps[10]=_T( " \n ");      
char       *token;      

token   =   strtok((char*)pbuf,   (char*)seps   );      
while(       token       !=       NULL       )      
{      
lin=i/2;
row=i%2;
addresslist.SetItemText(lin,row,(LPCTSTR)token);
token   =   strtok(NULL,(char*)seps);      
i++;
}  
}      
m_File.Close();  
}


pbuf中的数据是对的,但是token   =   strtok((char*)pbuf,   (char*)seps   );       以后token   就是乱码了,要怎么才能正常了
并且listctrl连乱码的现实都没有

我e:\\adsbook.txt文件内容是
姓名 ip
章三 196.168.3.1
李四 163.25.1.1
李五 163.25.1.2
章六 196.168.3.1
中间是tab
想实现的是在listctrl内按此格式显示。榜定没有问题

------解决方案--------------------
你的方法没问题,不过应该先给它初始化一下吧,例如这样插入十个条目再操作:

void CAdsBkDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);

CString strText;
CFile m_File;
CFileException e;
ULONGLONG dwLength;
for (int i=0;i < 10;i++)
{
strText.Format(TEXT( "item %d "), i);

// Insert the item, select every other item.
m_listctr.InsertItem(
LVIF_TEXT|LVIF_STATE, i, strText,
(i%2)==0 ? LVIS_SELECTED : 0, LVIS_SELECTED,
0, 0);

}
m_listctr.InsertColumn(0,_T( "名前 "),LVCFMT_LEFT, 60);
m_listctr.InsertColumn(1,_T( "IP "),LVCFMT_LEFT,160);
BOOL bopened = m_File.Open(_T( "f:\\adsbook.txt "),CFile::modeRead,&e);
dwLength=m_File.GetLength();
if(!bopened)
{
MessageBox(_T ( "FILE CAN 'T OPEN! "),_T ( "Error "),MB_OK);
return;
}
else
{
TCHAR *pbuf;
int *size;
int i=0;
int lin=0;
int row=0;
pbuf=(TCHAR*)malloc(dwLength);
TCHAR puf[100][20];
m_File.SeekToBegin();
m_File.Read(pbuf, dwLength);


TCHAR seps[10]=_T( " \n ");
char *token;

token = strtok((char*)pbuf, (char*)seps );
while( token != NULL )
{
lin=i/2;
row=i%2;
m_listctr.SetItemText(lin,row,(LPCTSTR)token);