This is a discussion on 'CreateWindowExW' : cannot convert parameter 2 from 'char [14]' to 'LPCWSTR' within the Windows Programming forums, part of the Platform Specific Boards category; Why does this code flag error. (Don't be daunted by the length of the code, the error is simple and ...

Remove the space between TEXT and ( ... you've made this error in several places... TEXT is a macro not a function call and it's going to be sensitive to the correct spacing. (i.e. the macro's name is TEXT( not TEXT )

This cannot be your complete code... because in order for it to be trying to use CreateWindowExW ... instead of CreateWindowExA you have to have UNICODE defined someplace... also you are not listing any include files... which is going to lead to TONS of errors in windows.

Also... DO NOT define separate classes for each window. Define one class for the base window in the application then make windows in that class... i.e. using the same class registration.

Remove the space between TEXT and ( ... you've made this error in several places... TEXT is a macro not a function call and it's going to be sensitive to the correct spacing. (i.e. the macro's name is TEXT( not TEXT )

still the same error. The code compiles with MSVC 6.0 and flags error with MSVC 2010..

Why are you not including windows.h and several other necessary headers?

Ok, I'm going to break ranks and give you some advice here...

1) Read this and take it to heart... Trust me, you'll be glad you did on the day you have a REAL problem.

2) While learning... Pick ONE compiler and stick to it. All you are ever going to accomplish with all these different compilers is to confuse the complete heck out of yourself. I generally recommend Pelles C because it is a standards conforming compiler with an IDE and tool chain that has a complete set of Windows development tools, including resource editors which are absent from other free compilers.

3) Get a good book/tutorial and stay with it end to end. Read every word, make a very deliberate study of it. Manually type up all the exercises and do all the quizes starting from a blank page... when you finish that, THEN you can start branching out and playing around. As it is now I frequently see you trying to do things with roughly 1/4 of the knowedge you actually need to do a proper job... and expecting us to make up for your poor study habits. That simply isn't going to cut it out in the real world. If you ever expect to work as a programmer, you need to foster a very self-sufficient learning style because, as you're going now, you will very quickly burn up everyone's patience and then you will be faced with the reality you've created... that you never actually learned how to program!

I mean you no personal offense... I am sincerely trying to get you going down the right path here... The one thing I can promise you is that how you're going at this now isn't going to cut it.