I'm getting "error C2039: 'AllocSysString' : is not a member of 'System::Char' error.
I'm trying to assign the result to a string variable.
wchar_t str;
return str.AllocSysString();
But I'm getting the above error.
I'm getting "error C2039: 'AllocSysString' : is not a member of 'System::Char' error.
I'm trying to assign the result to a string variable.
wchar_t str;
return str.AllocSysString();
But I'm getting the above error.
AllocSysString()
is not a method of wchar_t
, but of BSTR
IIRC.
So how should I solve this? sorry I'm new to C++.
Actually AllocSysString() returns a BSTR but it's a member of CString. Change the wchar_t to Cstring:
Cstring str;
return str.AllocSysString();
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.