3 Questions after completing first day of Visual C++ Book

Baseline

New member
I have toyed with HTML, VB, and C++ in the past. I am making a commitment now to learn Visual C++ with Learn Visual C++ 6 in 21 Days, seeing as I have a good copy of MSVC++ 6 Standard for myself. I have read these Learn to programming books by SAMS publishing before and they are nice books. Just never got the time to make the commitment. Last night I finished my first day in this book, which was actually pretty comfortable and enjoyable, I was left with 3 questions to myself. Here they are:

1.) The first program in the book is a dialog-box program, which starts me off with an ok and cancel button. After completing the first lesson I wanted to add a third push button aside from the ok and cancel ones that originally came with it. After adding a push button to my main program window, then renaming the ID in properties to IDHEY, and the caption to Hey, all goes well up to there. Then I want to make it so when the user clicks the button, a message window pops up with a small message. I have done it for the OK that comes with the dialog-box when you create it by right clicking the ok button, going to class wizard, then selecting the IDOK and selecting BN_CLICKED and selecting add function and then editing the code MessageBox("Hello, you've clicked ok"); or whatever I would put in there... I want to do the same for a button I added myself to the program, but when I go to class wizard for the button I added, the object ID isn't there, which would be IDHEY... So what do I have to do?

2.) After I have come to a point in the development of my program, I want to save all of my work to this point to a backup location, just incase I decide to wander and expiriment with my programming and I do create some errors, I can just load up the last working point for my project. I've tried doing a save as before to a backup folder I made and I think it just saved the .cpp file and when I did screw up and got 2 errors I wanted to go back to where I last saved.. but when I did that it wouldn't all open.. it was giving me some error like all of the parts couldn't be found or something, I ended up doing my whole project over, and luckily in the beginning of the book they are small projects. So basically I need to know how to save at a certain point in my project so if I screw up I can just close that all and open back up to where I was.

3.)I had finished building, compiling and testing an exe for my first program. It came out simple and nice. No errors or warnings, and I even went along the tutorial changing things to my own ideas to expiriment. I wanted to send the .exe to a friend of mine through a file transfer, and I did. When he opened it, there was a .dll missing error and he couldn't get in the program. I figured there would be some .dll's or something that I would probably have to like put in a zip file with the executable and send to my friend, seeing as most programs you download aren't just the executable, usually they include some kind of .dlls or .ocx or some sort of library files. How do I find out the necessary files to include with my program?

I sortof thought maybe just because this is the first chapter/day in the book maybe what I am asking wasn't covered yet, but these questions don't seem too far off from where I am, so I figured I would try getting answers to them to clear my head before I start day 2 in the book. I tried reading over the first day and just couldn't figure out the answers. I appreciate the help/tips. :D

Thanks,
Dan
 
1: A future lesson
2: ditto
3: If the app was based on a Microsoft Foundation Class (MFC) template you need the MFC runtime: mfc42.dll
 
Hope you realize that Visual C++ is Microsoft centered. And Visual C++ 6.0 is getting replaced with Visual C++.NET.

If you want to learn C++, you might be better off with learning C/C++ from an ANSI based learning book (which I believe is also a Sams book "Learn C++ in 21 days". Borland will allow you to download the non-GUI C++ compiler for free. Or if you install Linux you can learn with the GNU C++ compiler.

Visual C++ is a great IDE but for learning C++ you might benefit more from Learn C++ in 21 days and then use the current book you have for learning Visual C++ (notice that your book happens to have an overview of C/C++ in the back).
 
pointreyes -> ummm No C++ is not being replaced with C# hence forth why there is a C++ 7.0 in VS.NET (Hopefully soon to be Updated as They've screwed some things up in it, one word UNSAFE... WTF? Why?


Sorry Just had to clear up that misconception
 
Nocain said:
pointreyes -> ummm No C++ is not being replaced with C# hence forth why there is a C++ 7.0 in VS.NET (Hopefully soon to be Updated as They've screwed some things up in it, one word UNSAFE... WTF? Why?


Sorry Just had to clear up that misconception

You might want to re-read my post, you assumed something that was clearly not even mentioned. There is no mention of C#, only of C++.NET in my previous post. From what I understand the IDE is different with the .NET platform so learning from a book about C++ version 6 might be confusing if a person needs to start learning C++.NET.
 
The differences aren't very signifignant for me so far, the main and most annoying difference being more difficult to use project properties. As far as the "learn in 21 days" series goes I think these books are worthless, everyone I have looked inside focuses on AppWizard as if writing a complex application was the same as using Word to create party invitations. I don't know any good books on straight windows API(I bought Microsoft Press "Programming Visual C++ hoping it would be an excellent book...AppWizard from the first page) but if you're interested in using MFC(bloated and slow) check out Introduction to MFC Programming With Windows it covers most of the essentials in a easy and straightforward way(as much as this is possible with MFC) and WITHOUT using AppWizard. Of course before you start windows programming you should do a little bit of console work, its not too important in my opinion but can make your life alot easier when you are just beginning.
 
Back
Top