strcpy((char*)lpdata,(char*)&strData);
->
memmove(lpdata,(LPCTSTR)strData);strcpy((char*)&str,(char*)lpdata);
->
str=(LPCTSTR)lpdata;