Hi,
I need to convert a type "string" to a type "*char" in my MFC console application.
I'm pulling some values out of the registry and storing them in a [class.string]. I want to use this as a parameter to open a file using CFile.
but when I compile I get the error:
************************************************************
error C2664: 'Open' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
************************************************************
The values I am getting from the registry are REG_SZ's and my function to read the reg does not work storing the values as "CHAR *VALUE"
So I thought the solution would be to change the STRING's to CHAR's? If so how?
~Thanks
I need to convert a type "string" to a type "*char" in my MFC console application.
I'm pulling some values out of the registry and storing them in a [class.string]. I want to use this as a parameter to open a file using CFile.
but when I compile I get the error:
************************************************************
error C2664: 'Open' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
************************************************************
The values I am getting from the registry are REG_SZ's and my function to read the reg does not work storing the values as "CHAR *VALUE"
So I thought the solution would be to change the STRING's to CHAR's? If so how?
~Thanks