i'm very confused and the others forums make me more confused :(
i'm using string, so i need convert string to WCHAR*:
const size_t len = filename.length() + 1;
wchar_t wcstring[len];
swprintf(wcstring, len, L"%s", filename.c_str());
Gdiplus::Image img2(wcstring);
the img2 read the file normaly, but i'm creating another Image variable in class private section:
class image
{
private:
ULONG_PTR m_gdiplusToken;
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
HDC hdcimage=CreateCompatibleDC(NULL);
Gdiplus::Graphics graphics;
Gdiplus::Image img;
///................
but for work in image constructors i must do(or i get several errors):
public:
image() : graphics(hdcimage),img((WCHAR*)(L"C:\\"))
{
//..................
but for string:
image( const string & filename) : graphics(hdcimage),img(towstring(filename))
{
//.............
i'm getting errors:
"call of overloaded 'Image(wchar_t)' is ambiguous"
why?? see my function:
wchar_t towstring(const std::string& s)
{
wchar_t Wstring;
int c = MultiByteToWideChar( CP_UTF8 , 0 , s.c_str() , s.size() , &Wstring, 0 );
return Wstring;
}
i'm confused from information that gevi me :(
so what is 'WCHAR'? how can i convert it to string?
i'm sorry, but i'm several confused with these :(