Please review my first tutorial

This is a discussion on Please review my first tutorial within the C++ Programming forums, part of the General Programming Boards category; I wrote a beginner's tutorial for making a blank window in C++ using the win32 API. I know there are ...

Please review my first tutorial

I wrote a beginner's tutorial for making a blank window in C++ using the win32 API. I know there are hundreds (if not thousands) of these types of tutorials, I just ask that you read it and give me your opinions. Like I mentioned, It really just gives a beginner something to refer to, it might not go over everything, it isn't a huge tutorial.

It's the only link on the page. I'm not the best at HTML either, so there isn't anything fancy, so try not to flame me for the format . But if you do really hate how my site looks, I guess its best I find out. I have also come to understand that I should probably make an HTML version, so I'll put a version in that form up as well. Should it be plain .html or does anybody mind .mht files?

Please give me any thoughts, opinions, ideas! Criticism of all kinds are welcome.

1. Graphics are unreadable unless I really zoom in ... you should crop out parts not needed and/or only focus on the dialog or menu or whatever the graphic is demonstrating. If you are demonstrating the whole screen, try taking the screen shot at a lower resolution window. I have a large 21" monitor and so I know people with smaller < 19 will really have problems.

2. Your definition of WIN32_LEAN_AND_MEAN is wrong. It has nothing to do with MFC, especially in the context of Windows API programming. Per microsoft:

VC_EXTRALEAN and WIN32_LEAN_AND_MEAN are used to exclude rarely-used services from Windows headers. VC_EXTRALEAN can only be used in MFC projects, but WIN32_LEAN_AND_MEAN can be used in any project.

3. Ok, you have basically taken the template from Dev-C++ and added more comments too it, however those comments don't really add anything usefull for example you wrote:

LPSTR lpszArgument is rarely used, it is usually called LPSTR lpCmdLine.

?!?! saying it is rarely used, does not help me to know when it should be used, plus I've notice you've made a lot of comments on the names of the variables(here and with hInstance) Why? at the beginning you said you assume the user knows c++. Then assume he knows that these are variable names and different programs may name them differently. What you should be concentrating on is the variable type. What is a LPSTR? What is a HINSTANCE? This is what a C++ programmer new to windows programming needs to know.

Finally, I don't mean to sound harsh and I hope you take these criticism positively to improve your tutorial, but as is, I could not recommend this to anyone. Look at other tutorials, like winprog.org or get Petzolds Windows programming book and look at the detail he puts into it.

One last thing, although, dev-c is a popular program and a quite capable windows programming tool, the template it uses is starting to become dated, I think it's been around since the beginning of DevC. I think there are current trends that dictate an update to this template. The biggest is Unicode awareness via tchar.h. Again, look at the tutorials at winprog.org

Hunter2- I see it on my side, and it sounds like Darryl can see them. I'll try to look into more, maybe there's something up.

Darryl- (Ouch!) Thanks for looking the tutorial over. I guess I'll address what I can.
1) I only included the picture to fill the blank space (I'd like to maybe get some frames or something going eventually). I took it out for now.

2) I'll update it to include that, but I've always learned that it was to speed up the compiler from having to include the extra stuff. People who use that are people who write games (not nessesarily, I know I know). I'll include the Microsoft comment.

3) Good point on the variable names, I'll fix that. It was stupid of me, I just forgot what it was like beginning.
As for the winprog/petzold comment, I KNOW my tutorial isn't nearly as good, but I'm only starting, and I think winprog probably went through revisions as well. The best way to look at this is that I can only go up.

4) The only reason I used Dev-C++'s template was so that I could refer to one compiler and one template the whole time. Like I said, this is only the first version of it. It's not exactly a tutorial as much as a reference.

As much as it was harsh it was helpful, and its comments like that, that make tutorials better. It's the whole point of the post! So thanks alot, version 2 will have your name in the bottom

Not great. LoadIcon has been superseded by LoadImage and can only load icons of size SM_CXICON by SM_CYICON. You didnt mention at all how useful window creation data is. This is a c++ forum yet you make no attempt to wrap the common startup code of most window apps into reusable classes.Have a look at Ken Fitlikes tuts and maybe try something more along those lines.

Stan, about the font colour, changing "basefont" to "font" and getting rid of the extra <BODY> tag at the top of the page seemed to do the trick, not sure if it's exactly what you're looking for though.