-Error reading characters of string

后端 未结 2 985
执念已碎
执念已碎 2021-01-05 05:56

I have the following block of code:

for( CarsPool::CarRecord &record : recs->GetRecords())
{
  LVITEM item;
  item.mask = LVIF_TEXT;
  item.cchTextMax         


        
2条回答
  •  温柔的废话
    2021-01-05 06:37

    It looks like you're trying to use the value of a C++ "string" in a C/Win32 call.

    stdstring.c_str() is the correct way to do it.

    ... BUT ...

    You should strcpy() the string to a temp variable, then make the Win32 call with the temp variable.

提交回复
热议问题