Pasting to a list control

Currently I have the copy function implemented such that when I select a row, it copies the rows, delimiting by tabs. For example here is a sample paste into notepad.

1/3/2004 15:50 PM LastName, FirstName (773) 588-2300

There are 4 columns hence 4 items of data: the date, the time, full name, and phone number.

When I paste, I want these items of data to fall into a new row (the first row at the very top). I am having a hard time achieving this.

This is my code thus far...

void CNatashaDlg::OnEditPaste()
{

// Test to see if we can open the clipboard first.
if (OpenClipboard())
{
// Retrieve the Clipboard data (specifying that
// we want ANSI text (via the CF_TEXT value).
HANDLE hClipboardData = GetClipboardData(CF_TEXT);

// Call GlobalLock so that to retrieve a pointer
// to the data associated with the handle returned
// from GetClipboardData.
char *pchData = (char*)GlobalLock(hClipboardData);

// Set a local CString variable to the data
CString strFromClipboard = pchData;

// Unlock the global memory.
GlobalUnlock(hClipboardData);

// Finally, when finished I simply close the Clipboard
// which has the effect of unlocking it so that other
// applications can examine or modify its contents.

m_logList.InsertItem(0, "");
m_logList.SetItemText(0, 0, "");
m_logList.SetItemText(0, 1, "");
m_logList.SetItemText(0, 2, "");
m_logList.SetItemText(0, 3, "");

CloseClipboard();
}

}

I'm not sure how to take whatever is in the clipboard and seperate it so that each columns gets the appropriate fields. Can someone help me with this? Thank you.
[1808 byte] By [Loungelo] at [2007-11-18 17:44:57]
# 1 Re: Pasting to a list control
m_logList.InsertItem(0, "");
m_logList.SetItemText(0, 0, "");
m_logList.SetItemText(0, 1, "");
m_logList.SetItemText(0, 2, "");
m_logList.SetItemText(0, 3, "");


The above code pick up the text from the clipboard successfully, but you are not using the vairble strFromClipboard and you are filling the first row with "" , so you see nothing.
Ejaz at 2007-11-11 1:25:50 >