   VC++ 2005 Express
  So I finally got with the program and downloaded VC++ 2005 Express but I am having problems.  First, I don't like the fact that the only project templates are for console apps, but that's not what this post is about, or maybe it is, I don't know.  See, I downloaded VC++ 2005, then downloaded the Platform SDK so I could do Win32 apps.  So I tried to build the standard tutorial windows code:#include <windows.h>const char className[] = "MainWindowClass";LRESULT CALLBACK WndProc( HWND    hWnd, UINT    Msg, WPARAM  wParam, LPARAM  lParam ) {switch(Msg) {case WM_CLOSE:DestroyWindow(hWnd);break;case WM_DESTROY:PostQuitMessage(0);break;default:return (DefWindowProc(hWnd, Msg, wParam, lParam));}return 0;}INT WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow) {WNDCLASSEX wc;wc.cbSize = sizeof(WNDCLASSEX);wc.style = 0;wc.lpfnWndProc = (WNDPROC)WndProc;wc.cbClsExtra = 0;wc.cbWndExtra = 0;wc.hInstance = hInstance;wc.hCursor = LoadCursor(NULL, IDC_ARROW);wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);wc.lpszMenuName = NULL;wc.lpszClassName = className;if(!RegisterClassEx(&wc)) {MessageBox(NULL, "Failed to Initialize Program", "Error", MB_OK | MB_ICONERROR);return 0;}HWND hWnd;hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, className, "First Win32 Program in a Long Time", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 400, 500, NULL, NULL, hInstance, NULL);if(!hWnd) {MessageBox(NULL, "Window Creation Failed", "Error", MB_OK | MB_ICONERROR);return 0;}ShowWindow(hWnd, SW_SHOW);UpdateWindow(hWnd);MSG msg;while(GetMessage(&msg, NULL, 0, 0)) {TranslateMessage(&msg);DispatchMessage(&msg);}return msg.wParam;}But I got a bunch of linker errors, more specifically, one for each function called in the program.  So it's either one of two things: I am not linking with a lib I should be linking with or it's just not set up to be a windows app.  I am thinking the latter is more likely, so I will just ask, where in VC++ 2005 is the equivilent of Project->Settings in VC++6 so I can add /subsystem:windows to make it compile as a Win32 app instead of a console app? Thanks.-AJ   
  When you create a project, even if you choose "console project" in the initial screen, you can change it under "advanced settings" on the next screen.   ;  Or, look here.   ;  To adjust the linker settings you go Project->Project name properties, select the "linker" folder from the left, from what I remember 2005 hasn't changed much layout with from 2003 so you should be able to adjust the output system to windows from the "system" option under linker.   ;  Thanks, that really helped alot, but wow, this is going to take some getting used to.  Even after I was able to get it set up for a windows app I still couldn't get my code working due to what appears to be a bunch of changes to some types.  Like char is no longer a char, it's a TCHAR.  It's not WinMain anymore, it's _tWinMain...WTF?  And I just have to ask, what the hell is an ATOM?  I know atoms as the building blocks of matter, not a C++ type.  Definitely going to take some getting used to.  Also, is the UNREFERENCED_PARAMETER(parameter) function necessary or optional?  From what I can tell it just lets the compiler know it doesn't do anything, thereby speeding things up a bit.  Anyway, thanks for the replies and helping me get used to this.-AJEDIT: I just removed all the UNREFERENCED_PARAMTER() calls in the code and it still works fine, so to answer my own question, no, they're not necessary.[Edited by - u235 on December 6, 2005 10:49:20 AM];Quote:Original post by u235Like char is no longer a char, it's a TCHAR.  It's not WinMain anymore, it's _tWinMain...WTF? Artifact of the days when Windows NT and Window 9x had to coexist (dark days indeed...). Windows NT supports Unicode, but Win9x doesn't (natively). Because of that, most of the Win32 functions are macros, not functions. MessageBox(), for example is a macro that expands to MessageBoxA() if _UNICODE is not defined, and MessageBoxW() if it does.Wide character strings/Unicode strings are a different type (wchar_t*) than ASCII strings (char*). The T* things are Microsoft's way of handling this. When Unicode is used, all of the T* stuff expands to the Unicode version, or expands to the ASCII version if Unicode is off.It's usually a waste of time to try to work with both. Pick one and stick with it; it will make your life much easier (prefer Unicode unless you *must* support Win9x).;  So how do I set up VC++ 2005 to use just Unicode, and once I do, can I go back to my safe zone of chars and WinMains? Thanks.-AJ   ;Quote:Original post by u235So how do I set up VC++ 2005 to use just Unicode, and once I do, can I go back to my safe zone of chars and WinMains? Thanks. Project->Properties->General->Character Set->"Not Set". I don't know if it can be changed globally; you'll probably have to do it for each project.;  You are a beautiful man, rating++.  It compiled with one warning: " return : conversion from WPARAM to int, possible loss of data" on the last line "return msg.wParam".  Also when I run the program there is an error registering the class.  Pertinent code below:   WNDCLASSEX wc;wc.cbSize = sizeof(WNDCLASSEX);wc.style = 0;wc.lpfnWndProc = (WNDPROC)WndProc;wc.cbClsExtra = 0;wc.cbWndExtra = 0;wc.hInstance = hInstance;wc.hCursor = LoadCursor(NULL, IDC_ARROW);wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);wc.lpszMenuName = NULL;wc.lpszClassName = className;if(!RegisterClassEx(&wc)) {MessageBox(NULL, "Failed to Initialize Program", "Error", MB_OK | MB_ICONERROR);return 0;}But thank you very much for getting me oh so close to where I want to be.-AJ   ;  No help?  Why is RegisterClassEx failing?  I'm not too concerned about the warning, but I really need to fix the class registering failure. Thanks.-AJ   