I'm having some trouble using the result returned by a "const" member function. Specifically, I'm iterating through a list of _bstr_t strings (_bstr_t is the type of one of the fields in my ADO recordset) and I want to store the length of the longest _bstr_t.
But, a statement like this one:
if (myBstr.length > currentMaxLength)
currentMaxLength = myBstr.length;
produces compiler error:
error C2440: '=' : cannot convert from
'unsigned int(__thiscall _bstr_t::*)(void) const' to 'int'
I've tried to cast myBsrt to an int, to an unsigned int, etc. I'm confused as to why this is incorrect because I simply want to make a copy of the value in myBstr.length - I'm not trying to change the const data member! Any help would be much appreciated.