Error in BSTR TagVariant After project Migration from VS2010 to VS2017
-
**Error in line :
CString sURL = URL->bstrVal;
//bstrVal is BSTR TagVariant Error is** error C2440: 'initializing': cannot convert from 'BSTR' to 'ATL::CStringT>>' 1> with 1> [ 1> _CharType=char 1> ] 1>note: Constructor for class 'ATL::CStringT>>' is declared 'explicit' 1> with 1> [ 1> _CharType=char 1> ]
-
**Error in line :
CString sURL = URL->bstrVal;
//bstrVal is BSTR TagVariant Error is** error C2440: 'initializing': cannot convert from 'BSTR' to 'ATL::CStringT>>' 1> with 1> [ 1> _CharType=char 1> ] 1>note: Constructor for class 'ATL::CStringT>>' is declared 'explicit' 1> with 1> [ 1> _CharType=char 1> ]
try
CString sURL = (LPCTSTR)(_bstr_t)URL->bstrVal;
-
**Error in line :
CString sURL = URL->bstrVal;
//bstrVal is BSTR TagVariant Error is** error C2440: 'initializing': cannot convert from 'BSTR' to 'ATL::CStringT>>' 1> with 1> [ 1> _CharType=char 1> ] 1>note: Constructor for class 'ATL::CStringT>>' is declared 'explicit' 1> with 1> [ 1> _CharType=char 1> ]