Scorch & VC++

Wanna understand E=mc2, English grammer, or maybe just build a computer? We can help!

Moderator: Moderators

Post Reply
User avatar
XMEN Gambit
Site Admin
Posts: 4122
Joined: Thu Nov 18, 1999 12:00 am

Scorch & VC++

Post by XMEN Gambit »

(I moved this discussion here from another thread)<br><br><!--EZCODE QUOTE START--><blockquote><b><i>Quote:</i></b><hr>Gambit you know Vc++? AND YOU DIDN"T TELL ME?<br>umm I am attempting to learn it on my own (big mistake) and umm I have Microsoft VC++ 6.0 and well was wondering if you could send some simple programs over (I know some C++, took AP computer Science) but I want to learn <hr></blockquote><!--EZCODE QUOTE END--><br><br>Hmm. What sort of stuff would you like to see, and what other sort of programming have you done in the past? Whose C++ did you learn in school? You WILL need to know the Win32 API, but not necessarily right away. You may want to just learn MFC or ATL to start with, and then study the API later to learn how things work underneath those MFC calls.<br><br>I have discovered that the hardest part of learning a computer language is often not the commands & syntax, but the environment the program will be executing in. For example, I knew C and moved into C++ and the windows environment at the same time, having to learn the Windows API, MFC, Microsoft's memory organization and other built-in goodies you were expected to know, and the OOP aspect at the same time. Fairly steep learning curve & it took me a while. When learning assembly, it's not the PUSH's and JEQ's that cause the problem, it's learning about which commands affect what registers and set what status flags, which byte is the high byte of a word, the memory layout, etc. There are exceptions to this, of course. The ones I've run into are non-procedural ones like LISP and Prolog, but I'm sure there are others.<br><br>So. Tell me what you know and what you want to know, and I'll be happy to help. I'm out of town next week though, so I may not be able to send you much though I'll still be checking the boards. <p><img src=http://members.aol.com/acvishar/images/g-avatar.gif border=0 align=left>XMEN member<br>DTM Applicant<br>OKL Fish-napper<br><br><br><br><br><br><br>Poker, anyone?</p><i></i>
Image
Scorch
Inmate
Posts: 215
Joined: Thu Mar 16, 2000 12:02 am

Re: Scorch & VC++

Post by Scorch »

well a breif history<br><br>I started out with Microsoft QBASIC a few years ago, moved to Borland Turbo Pascal at school, then to AP Computer science taught in Borland C++ 4.0, I then went out and bought Microsoft Visual C++.<br><br><br>my goal is to be able to write programs for windows 95/98/2000 (okok I want to write my own games <!--EZCODE EMOTICON START :) --><img src=http://www.ezboard.com/intl/aenglish/im ... /smile.gif ALT=":)"><!--EZCODE EMOTICON STOP--> )<br><br>what I would like is to start off simple I know the majority of syntax for c++ and VC++ is a bit diffrent but i'm managing to hammer some things out. yes MFC would be nice I just need to know I guess how to 1) build my own structs if its diffrent from Borland c++, 2) openclose files if diffrent 3) and umm when I write a program all output is to the ugly Dos window thingy how do I get a nice white background or plain application like Borlans when it outputs? <p></p><i></i>
User avatar
XMEN Gambit
Site Admin
Posts: 4122
Joined: Thu Nov 18, 1999 12:00 am

Re: Scorch & VC++

Post by XMEN Gambit »

Whee! Wanna write games for windows, eh? Well, for the cool ones you'll want to learn DirectX. And that's quite a chunk all by itself. I can't help you much with DirectX; maybe we can learn together.<br><br>A couple of ways to get the text output to a window. One of the easist one I can think of to explain on the BBS is to create a window/dialog box with a big edit box in it, then set the text property of the edit box to the text you want (this is basically what Notepad is). Of course, you can do the same thing with a plain text control too.<br><br>For file access, look up the docs on the 'file' object. There's only a few methods you'll need to know to get it working.<br><br>Stucts? Why use structs?? <!--EZCODE EMOTICON START :) --><img src=http://www.ezboard.com/intl/aenglish/im ... /smile.gif ALT=":)"><!--EZCODE EMOTICON STOP--> In an OOP world, you should create an object with private data members and use 'get' and 'set' public methods to change the data. Kind of a purist view, and you'll break this rule later if you really write games, but you ought to get into the habit - it makes changing things later SO much easier.<br><br>If your output has so far been to a DOS window, it sounds like you're building a 'console' app. This is a 32-bit DOS app, essentially, and you won't get any windows that way but it has to be run under windows to work. You'll need to create a new project. I don't have VC++ on my work machine, so I can't look up the exact option, but it will say 'MFC Executable' or 'Windows Executable' or some such.<br><br>Is this helping, Scorch? <!--EZCODE EMOTICON START ;) --><img src=http://www.ezboard.com/intl/aenglish/im ... s/wink.gif ALT=";)"><!--EZCODE EMOTICON STOP--> I won't be able to send you actual code until I get back.<br> <p><img src=http://members.aol.com/acvishar/images/g-avatar.gif border=0 align=left>XMEN member<br>DTM Applicant<br>OKL Fish-napper<br><br><br><br><br><br><br>Poker, anyone?</p><i></i>
Image
Scorch
Inmate
Posts: 215
Joined: Thu Mar 16, 2000 12:02 am

Re: Scorch & VC++

Post by Scorch »

its helping a bit <!--EZCODE EMOTICON START :) --><img src=http://www.ezboard.com/intl/aenglish/im ... /smile.gif ALT=":)"><!--EZCODE EMOTICON STOP--> <br><br>O and thats somthing else that was causing probelms for me the whole public privite thingy <!--EZCODE EMOTICON START :) --><img src=http://www.ezboard.com/intl/aenglish/im ... /smile.gif ALT=":)"><!--EZCODE EMOTICON STOP--> <br><br>maybe I should go back to basic <!--EZCODE EMOTICON START :) --><img src=http://www.ezboard.com/intl/aenglish/im ... /smile.gif ALT=":)"><!--EZCODE EMOTICON STOP--> <br><br>humm i'll try that but what do I need to use to create windows (other then a hammer some 2x4, glass and nails) <!--EZCODE EMOTICON START :) --><img src=http://www.ezboard.com/intl/aenglish/im ... /smile.gif ALT=":)"><!--EZCODE EMOTICON STOP--> <!--EZCODE EMOTICON START :) --><img src=http://www.ezboard.com/intl/aenglish/im ... /smile.gif ALT=":)"><!--EZCODE EMOTICON STOP--> anyways umm thanks for the help I look forward to getting help from you <!--EZCODE EMOTICON START :) --><img src=http://www.ezboard.com/intl/aenglish/im ... /smile.gif ALT=":)"><!--EZCODE EMOTICON STOP--> <p></p><i></i>
User avatar
XMEN Gambit
Site Admin
Posts: 4122
Joined: Thu Nov 18, 1999 12:00 am

Re: Scorch & VC++

Post by XMEN Gambit »

Ok, <!--EZCODE BOLD START--><b>public, private,</b><!--EZCODE BOLD END--> and <!--EZCODE BOLD START--><b>protected</b><!--EZCODE BOLD END--> apply to members of a class. This includes variables, methods, functions, and other even structs and other class definitions, if they are defined within the first class. Constructors/destructors can be made non-public if you want to restrict creation/destruction of objects of this type.<br><br>Private members can only be 'seen' (read/written/called) from within the class.<br><br>Protected can be seen within the class, and classes derived from it. (and from classes defined as 'friends' of the class)<br><br>Public can be seen and modified by anyone having access to the object made from the class definition. Public is the default.<br>--------------------<br>The easiest way I can think of to display a window is to use the resource editor to create a simple dialog box and assign it a class name with the ClassWizard. Then, within your program, you define a variable of the class type - an object. Then call the dialog's DoModal() method. This is the MFC way to do it. Here's a simple method showing the code:<br><br>void ShowMyDialog()<br>{<br> CMyDialogClass dlgMyDialog;<br><br> dlgMyDialog.DoModal();<br>}<br><br>****<br>Gee, this is fun. I haven't been actively using C++ for over a year now, and I miss it. You're making me remember/think about/learn things when you ask these questions. Woohoo! <!--EZCODE EMOTICON START :) --><img src=http://www.ezboard.com/intl/aenglish/im ... /smile.gif ALT=":)"><!--EZCODE EMOTICON STOP--> Of course, that also means I could be telling you something wrong. Try stuff out and call me on it if you find an error. <p><img src=http://members.aol.com/acvishar/images/g-avatar.gif border=0 align=left>XMEN member<br>DTM Applicant<br>OKL Fish-napper<br><br><br><br><br><br><br>Poker, anyone?</p><i></i>
Image
Scorch
Inmate
Posts: 215
Joined: Thu Mar 16, 2000 12:02 am

Re: Scorch & VC++

Post by Scorch »

i've been really busy and haven't had a chance to sit down and program but Thank you for the help, I will be back in 3 days (bussiness trip to Arizona with dad) and then maybe I can attempt to program <!--EZCODE EMOTICON START :) --><img src=http://www.ezboard.com/intl/aenglish/im ... /smile.gif ALT=":)"><!--EZCODE EMOTICON STOP--> <p></p><i></i>
ratfink182
Posts: 1
Joined: Thu Apr 06, 2000 1:31 pm

Re: Scorch & VC++

Post by ratfink182 »

*GAMBIT begin edit*<br>Heya, Ratfink, good to see you. I was just cleaning house and deleted your early test posts that were here.<br>*GAMBIT end *<br><br>test4 <p></p><i>Edited by <A HREF=http://pub3.ezboard.com/uxmengambit.sho ... ofile>XMEN Gambit</A>&nbsp; <IMG SRC=http://homepages.go.com/~keeter67/x.gif width=15 height=15 BORDER=0> at: 4/7/00 7:58:40 am<br></i>
Post Reply