Hi,
I've been trying to get a demo program for DirectX to run and I'm getting the following error log when compiling:
- cannot convert `const wchar_t[12]' to `const CHAR*' in assignmentThe code defines a structure of type WNDCLASSEX with a variable name called 'wc'. When it hits the following line:- cannot convert `const wchar_t*' to `const CHAR*' for argument `2' to `HWND__* CreateWindowExA(DWORD, const CHAR*, const CHAR*, DWORD, int, int, int, int, HWND__*, HMENU__*, HINSTANCE__*, void*)'
It gets mad. I checked out online what the structure WNDCLASSEX has as its defined data members and it seems the variable lpszClassName requires a pointer to a classname which is terminated with a null character - which as I understand can be represented with '/0'. I don't think the null character is an issue though as if you look it is complaining that an array called wchar_t[12] cannot convert to what looks like a pointer to a constant variable of type char - but written in capitals for some reason. Given that there are 11 letters in the name "Windowclass" then it follows that the code must have implemented a null character automatically as the array size is 12 not 11.wc.lpszClassName = L"WindowClass";
I also thought an array variable was basically just read as a pointer by code too. So it seems to me that the data member of the structure WNDCLASSEX is being passed a pointer to a null terminated string, yet the program still complains.
Can anyone shed any light on this, is this an issue relating to a windows version which is out of date or something? Cheers!