Q:

Populate a Virtual ListView with std::vector

I have a vector of thousands of strings:
std::vector<std::wstring> a;

filled with some algorithms.
Following the method described here, here is how I create a ListView as a "virtual list":
hList = CreateWindowEx(0, WC_LISTVIEW, L"", WS_CHILD | WS_VISIBLE | LVS_REPORT | LVS_OWNERDATA, 0, 0, 800, 400, hWnd, (HMENU)ID_LISTVIEW, hInst, NULL);

LV_COLUMN lvcol;
...
ListView_InsertColumn(hList, 0, &lvcol);

ListView_SetItemCountEx(hList, 100000, LVSICF_NOSCROLL);

...

// in the message loop
case WM_NOTIFY:
    pdi = (NMLVDISPINFO*) lParam;
    pi = pdi->item;
    switch (pdi->hdr.code)
    {
        case LVN_GETDISPINFO:
        {
            pi.mask = LVIF_TEXT;
            pi.pszText = a[pi.iItem];    // the nth item should be the nth string in the vector
        }
    }

I tried a lot of variations on:
pi.pszText = a[pi.iItem];

but they all failed with such kind of errors:

Error C2440: '=' : cannot convert from 'std::basic_string,std::allocator>' to 'LPWSTR'  

What could help to do this?

Note: in fact I would like to display on row n of the ListView : the nth string of vector a concatenated with the number n, like this Blabla217 on the row 217.
Note2: even after Igor's suggestion (i.e. a cast pi.pszText = LPWSTR(a[pi.iItem].c_str());), the ListView is still empty, instead of displaying elements.

A:

I  don't really know why, but this solved it:
case WM_NOTIFY:
    pdi = (NMLVDISPINFO*) lParam;
    //pi = pdi->item;
    switch (pdi->hdr.code)
    {
        case LVN_GETDISPINFO:
        {
            //pi.mask = LVIF_TEXT;
            pdi->item.mask = LVIF_TEXT;;
            //pi.pszText = a[pi.iItem];   
            pdi->item.pszText = a[pi.iItem];   
        }
    }

