Oh, notised that this one is not a console program, right?
I try to create a new, windows -based project.
Let you know if this works ...
--------
Hmm... Could not get it throuh. This is somehow confusing me.
The problem is that Visual Studio 2005, 2008 etc defaults to UNICODE builds.
Your code contains string literals like "Hello World".
These are ANSI (8 bit strings) not unicode (wide char) strings.
There two things you can do:
1. Go Project -> Properties Select each of the builds (debug and Releae) in turn and under Configuration Properties ->general change the Character Set properties from Use UNICODE character set to Use multi-byte character set.
OR
2. Find all the string literals in the code and put a capital L in front of them
so that they look something like this L"Hello World"
I'll test it this evening and let you know how it goes.
Notised also that there is SP1 available for Visual C++ 2008 Express Edition. I'll update as soon as have some time to do it :-) Also notised that Microsoft MSDN Express Library must be installed separately. Will do that also same time.
---------- Edit
Hmmm ... Could not get it work. Got different type of error messages, all started with letter C.
I should have added that the L option always create a wide string (unicode).
the _T macro either makes a UNICODE or standard C string depending on
whether UNICODE has been defined. For example _T("Hello World") - notice the use of the brackets. So it is the safer option.
Got too optimistic. Above was after creating a new Win32 Console Application. After creating a new CLR Empty Project got the same 25 errors as before. The errors were like:
WinTut.obj : error LNK2028: unresolved token (0A000041) "extern "C" struct HICON__ * __stdcall LoadCursorA(struct HINSTANCE__ *,char const *)" (?LoadCursorA@@$$J18YGPAUHICON__@@PAUHINSTANCE__@@PBD@Z) referenced in function "public: __thiscall WinTut::WinTut(struct HINSTANCE__ *)" (??0WinTut@@$$FQAE@PAUHINSTANCE__@@@Z)
WinTut.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall GetMessageA(struct tagMSG *,struct HWND__ *,unsigned int,unsigned int)" (?GetMessageA@@$$J216YGHPAUtagMSG@@PAUHWND__@@II@Z) referenced in function "extern "C" int __cdecl GetMessage(struct tagMSG *,struct HWND__ *,unsigned int,unsigned int)" (?GetMessage@@$$J0YAHPAUtagMSG@@PAUHWND__@@II@Z)
Hmm... Obviously it is not very clear to me what kind of template to use. Maybe this code is not possible to build under CLR? Just thought it would be better to do project building within CLR in order to get a program (exe-file) for several platform/OS at one go. I'm not sure if I have got the idea of CLR right, but this is how I understood it.