Click to See Complete Forum and Search --> : VS. NET : conversion problem with strings : I need Help


hajer
April 3rd, 2003, 08:58 AM
Hi to all,

I installed VS .NET and i want to build a C++ project which didn't have any problem. I obtained some errors related to the use of the string type.

The C++ code is the following :

....
....
USES_CONVERSION;
string str = OLE2T(*name); // name is BSTR *
long res = function1(str.begin());
....

The resulted error is :

cannot convert parameter 1 from 'std::basic_string<_Elem, _Traits, _Ax>::iterator' to 'char *'

with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]

Please Help me if you have any solution to such problem.

HeartBreakKid
April 3rd, 2003, 09:40 AM
Post the declaration of function1().

hajer
April 3rd, 2003, 09:49 AM
the declaration of function1 is :

long function1(char* str);