msoftcon.cpp

hello everyone ;
I was in chapter 13 in object oriented programming in c++ fourth edition(I know it is out of date but after 12 chapters it would be better to continue)
and now I am in elev program and there is a little problem in msoftcon.cpp
1
2
3
 hConsole = CreateFile("CONOUT$", GENERIC_WRITE | GENERIC_READ,
                   FILE_SHARE_READ | FILE_SHARE_WRITE,
                   0L, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0L);

and here is the report
1
2
3
1>  msoftcon.cpp
1>d:\c++\كتب\كتب انجليزى\object-oriented programming in c++ (4th edition)\msoftcon\msoftcon.cpp(51): error C2664: 'CreateFileW' : cannot convert parameter 1 from 'const char [8]' to 'LPCWSTR'
1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
You might want to use the _T() or _TEXT() macro for the string:

hConsole = CreateFile(_T("CONOUT$"), ...);
what is the header file for these fuctions
Topic archived. No new replies allowed.