Thread: Please review my first tutorial

  1. #1
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361

    Smile 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.

    I humbly submit...
    My 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.
    Stan The Man. Beatles fan

    When I was a child,
    I spoke as a child,
    I thought as a child,
    I reasoned as a child.
    When I became a man,
    I put childish ways behind me"
    (the holy bible, Paul, in his first letter to the Cor. 13:11)

  2. #2
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Neither link on the site works, the image link is broken, and you have black text on a black background.

    Try revising?
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  3. #3
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    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

    Darryl

  4. #4
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361
    Thanks for the comments!

    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

    Anyone else got the guts to flame me?
    Stan The Man. Beatles fan

    When I was a child,
    I spoke as a child,
    I thought as a child,
    I reasoned as a child.
    When I became a man,
    I put childish ways behind me"
    (the holy bible, Paul, in his first letter to the Cor. 13:11)

  5. #5
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    Your PDF link crashed my Firefox

    Which might be because my trial of Acrobat Reader has expired (so I cant open that) and Firefox kept trying to get it open so it could make a window for it.
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  6. #6
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Well, Stan100, here's a screenshot of what I see (I highlighted the text so you could see it, and then clicked the PDF link so you can see the error message).
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  7. #7
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    Quote Originally Posted by Stan100
    Thanks for the comments!

    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.
    I couldn't see it, I had to figure out how to get to it....
    use this link

    http://stan100.zoomcities.com/Tutori...20in%20C__.pdf

  8. #8
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    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.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  9. #9
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361
    Alright guys, I'm going to take some time today to make some revisions. Sorry!

    As for the HTML, could you help me out? Can you check the source? I have the font set as white, I'm not great at it though, and maybe I have an error somewhere.
    Stan The Man. Beatles fan

    When I was a child,
    I spoke as a child,
    I thought as a child,
    I reasoned as a child.
    When I became a man,
    I put childish ways behind me"
    (the holy bible, Paul, in his first letter to the Cor. 13:11)

  10. #10
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361
    I may have fixed the black text on black background problem. Before I had

    Code:
    <basefont face="Arial" size="4" color="white">
    I guess "white" doesn't work for FFX?

    Code:
    <basefont face="Arial" size="4" color="#FFFFFF">
    Tell me if that works. I'm going to fix the tutorial now.

    *EDIT*
    Also fixed the link to the .pdf. I was linking to http://www.stan1...
    instead of http://stan.1....

    Again thanks alot everyone. Right now I'm fixing the actual .pdf, and I'll be sure to include you!

    *EDIT AGAIN*
    Made file a .rar so it wouldn't freeze/not AS annoying.
    Last edited by Stan100; 06-21-2005 at 11:32 AM.
    Stan The Man. Beatles fan

    When I was a child,
    I spoke as a child,
    I thought as a child,
    I reasoned as a child.
    When I became a man,
    I put childish ways behind me"
    (the holy bible, Paul, in his first letter to the Cor. 13:11)

  11. #11
    Registered User
    Join Date
    Jun 2004
    Posts
    722

  12. #12
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361
    Thanks xErath. Like I said, I don't know anything about html. I'm reading what you gave me now.
    Stan The Man. Beatles fan

    When I was a child,
    I spoke as a child,
    I thought as a child,
    I reasoned as a child.
    When I became a man,
    I put childish ways behind me"
    (the holy bible, Paul, in his first letter to the Cor. 13:11)

  13. #13
    Registered User
    Join Date
    Jun 2004
    Posts
    722
    I learned html by looking at pages source, playing with frontpage (i know it produces horrible code), riping scrits.. whatever. Also, I recentl had to develop a small website in php.

  14. #14
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    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.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. My new website
    By joeprogrammer in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 03-17-2006, 07:38 PM
  2. Cprog tutorial: Design Patterns
    By maes in forum C++ Programming
    Replies: 7
    Last Post: 10-11-2004, 01:41 AM
  3. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 09:40 PM
  4. Problem with tutorial (Vector class)
    By OdyTHeBear in forum C++ Programming
    Replies: 4
    Last Post: 12-18-2002, 02:49 PM
  5. My DirectInput tutorial....
    By jdinger in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 06-18-2002, 11:32 PM