Beginner Needs Help
-
Hello, I know php, actionscript/javascript and a basic perl. I trying now to learn visual c++ because I want to make applications. I have visual c++ but I'm not really sure what I'm doing, I have a few books from my brother (a programmer) and have tried to follow the exercises but I'm still lost. When I write something in php or javascript I know what all of it does as I write the functions myself but with visual c++ I just drag things around and double click on them and give them names etc like the exercises say but I really have know idea where the code is or what particular file is being edited when I do try and change a value or property. I had a look at some of the c++ files in my workspace directories and it all looks quite complicated with lots of comments saying add stuff here or 'class wizard will add properties here)'. Should I try and edit this so I understand it a bit better or will this just screw things up? Before I started I thought it would be more like php where I write lots of functions and then just tell buttons what to do when they have been clicked but it's difficult to understand the code as it uses wierd names and ids (BTW: do ID names all have to be in UPPERCASE? I find that annoying.) for things, things I have know idea about because it was all created automatically. Is there anyway of writing an application from scratch and doing all the code by hand so that I know what everything does? Or is this not the point of visual c++? Or maybe s.o. has links for beginners on writting applications with v. c++. Any advice would be great.
-
Hello, I know php, actionscript/javascript and a basic perl. I trying now to learn visual c++ because I want to make applications. I have visual c++ but I'm not really sure what I'm doing, I have a few books from my brother (a programmer) and have tried to follow the exercises but I'm still lost. When I write something in php or javascript I know what all of it does as I write the functions myself but with visual c++ I just drag things around and double click on them and give them names etc like the exercises say but I really have know idea where the code is or what particular file is being edited when I do try and change a value or property. I had a look at some of the c++ files in my workspace directories and it all looks quite complicated with lots of comments saying add stuff here or 'class wizard will add properties here)'. Should I try and edit this so I understand it a bit better or will this just screw things up? Before I started I thought it would be more like php where I write lots of functions and then just tell buttons what to do when they have been clicked but it's difficult to understand the code as it uses wierd names and ids (BTW: do ID names all have to be in UPPERCASE? I find that annoying.) for things, things I have know idea about because it was all created automatically. Is there anyway of writing an application from scratch and doing all the code by hand so that I know what everything does? Or is this not the point of visual c++? Or maybe s.o. has links for beginners on writting applications with v. c++. Any advice would be great.
Stephen Bungert wrote: Should I try and edit this so I understand it a bit better or will this just screw things up? writing C++ apps is all about editing the .CPP and .H files. all that stuff that Visual Studio does is nice, but it only handles a very small part of the whole thing. Stephen Bungert wrote: Before I started I thought it would be more like php where I write lots of functions and then just tell buttons what to do that's exactly what VC++ programming is all about. the dev environment will write stub functions for event-captures for you (button presses, paint events, etc). then you go and fill them in. Stephen Bungert wrote: BTW: do ID names all have to be in UPPERCASE? no, but it's the standard. C/C++ macros (ie. #defines) are usually in all upper case. Stephen Bungert wrote: Is there anyway of writing an application from scratch and doing all the code by hand so that I know what everything does? Or is this not the point of visual c++? you can write console apps (DOS window apps) with no UI from scratch with VC++ . but if you want to do anything with Windows it's best to let VC generate the skeleton app for you. my advice: start with a "dialog app". that's an application that starts as a single dialog. it will save you from the horrors of the Doc/View paradigm. the default dialog has OK and Cancel buttons - have VC create event handlers for those two functions, then put some of your own code in there to see what they do (hint: AfxMessageBox(...); can be handy). then add some other controls and play around with them. edit controls are pretty simple. list and combo boxes are a bit more complex, etc.. Cleek | Image Toolkits | Thumbnail maker
-
Hello, I know php, actionscript/javascript and a basic perl. I trying now to learn visual c++ because I want to make applications. I have visual c++ but I'm not really sure what I'm doing, I have a few books from my brother (a programmer) and have tried to follow the exercises but I'm still lost. When I write something in php or javascript I know what all of it does as I write the functions myself but with visual c++ I just drag things around and double click on them and give them names etc like the exercises say but I really have know idea where the code is or what particular file is being edited when I do try and change a value or property. I had a look at some of the c++ files in my workspace directories and it all looks quite complicated with lots of comments saying add stuff here or 'class wizard will add properties here)'. Should I try and edit this so I understand it a bit better or will this just screw things up? Before I started I thought it would be more like php where I write lots of functions and then just tell buttons what to do when they have been clicked but it's difficult to understand the code as it uses wierd names and ids (BTW: do ID names all have to be in UPPERCASE? I find that annoying.) for things, things I have know idea about because it was all created automatically. Is there anyway of writing an application from scratch and doing all the code by hand so that I know what everything does? Or is this not the point of visual c++? Or maybe s.o. has links for beginners on writting applications with v. c++. Any advice would be great.
well, I remember my first days trying to figure Vc++ out... I think part of the problem is you're coming from the php, javascript/actionscript world which is the "interpreted" language world into the C++ world, which is "compiled" code. The whole point of php and other scripting languages is to make it easy for people to generate snippets of code that accomplish certain tasks, limitted in capabilities and performance. I found that starting out by trying to understand the win32 programming basics helps a lot when dealing with VC++. The thing is all MFC does is it makes Win32 programming a lot easier, but that is only true for those who either know their way around Win32 standard programming, or those who don't care to understand the underlying paradigms of win32 programming. You seem to be one of those who likes to understand the underlying principles before building on top of them, so I'd suggest starting with a Win32 Application project... the "Hello World" example, and don't include any MFC support in the beginning. Try to understand the concept of Window as base class for almost all other classes in the Win32 environment. Once you grasp the Window concept, how to create one, what is the message pump, what are messages, how to handle them.. then you can move on and start getting into the more advanced stuff. Good luck!
-
Hello, I know php, actionscript/javascript and a basic perl. I trying now to learn visual c++ because I want to make applications. I have visual c++ but I'm not really sure what I'm doing, I have a few books from my brother (a programmer) and have tried to follow the exercises but I'm still lost. When I write something in php or javascript I know what all of it does as I write the functions myself but with visual c++ I just drag things around and double click on them and give them names etc like the exercises say but I really have know idea where the code is or what particular file is being edited when I do try and change a value or property. I had a look at some of the c++ files in my workspace directories and it all looks quite complicated with lots of comments saying add stuff here or 'class wizard will add properties here)'. Should I try and edit this so I understand it a bit better or will this just screw things up? Before I started I thought it would be more like php where I write lots of functions and then just tell buttons what to do when they have been clicked but it's difficult to understand the code as it uses wierd names and ids (BTW: do ID names all have to be in UPPERCASE? I find that annoying.) for things, things I have know idea about because it was all created automatically. Is there anyway of writing an application from scratch and doing all the code by hand so that I know what everything does? Or is this not the point of visual c++? Or maybe s.o. has links for beginners on writting applications with v. c++. Any advice would be great.
i'm also a beginner of vc++ 6. i even blur of c++ indeed. i jst hv sth share wth u, duno whether can help u or nt, bt maybe can cheer u up..hehe..c++ fundamental is very important b4 u start to learn vc++ 6. the vc++ 6 bible and teach urself vc++ 6 in 21 days and the beginning of vc++ are quite a good book. some ebook like teach urself c++ in 21 days is also very useful for me to understand some basic of c++ fast. every language is different. it takes time to learn. be patient. i believe in patient learning make ur life wonderful . i still hv one mths to pass up my vc++ project, i hope i can fulfill it with the some help of engineer as i wish. gambadei( keep up gd work)...gd luck.
-
Hello, I know php, actionscript/javascript and a basic perl. I trying now to learn visual c++ because I want to make applications. I have visual c++ but I'm not really sure what I'm doing, I have a few books from my brother (a programmer) and have tried to follow the exercises but I'm still lost. When I write something in php or javascript I know what all of it does as I write the functions myself but with visual c++ I just drag things around and double click on them and give them names etc like the exercises say but I really have know idea where the code is or what particular file is being edited when I do try and change a value or property. I had a look at some of the c++ files in my workspace directories and it all looks quite complicated with lots of comments saying add stuff here or 'class wizard will add properties here)'. Should I try and edit this so I understand it a bit better or will this just screw things up? Before I started I thought it would be more like php where I write lots of functions and then just tell buttons what to do when they have been clicked but it's difficult to understand the code as it uses wierd names and ids (BTW: do ID names all have to be in UPPERCASE? I find that annoying.) for things, things I have know idea about because it was all created automatically. Is there anyway of writing an application from scratch and doing all the code by hand so that I know what everything does? Or is this not the point of visual c++? Or maybe s.o. has links for beginners on writting applications with v. c++. Any advice would be great.
Hi, understanding the 'Visual' part of Visual C++ (MFC) becomes much more easier, if you learn the basics of object orientation first. So don't start with a GUI application but create your own small console-based projects first, add some classes and let them interact. 1. Start a new console-based project 2. Add a source-code file to that project 3. Define your main() function MyFirstProject.cpp looks like this:
#include <iostream>
using namespace std;
void main()
{
cout << "Hello World" << endl;
}4. Create your first object (an object of the string class) MyFirstProject.cpp looks like this:
#include <iostream>
#include <string>using namespace std;
void main()
{
string text;text = "Hello World";
cout << text << endl;
}5. Extract your first function MyFirstProject.cpp looks like this:
#include <iostream>
#include <string>using namespace std;
void showMe(const string& Text)
{
cout << Text << endl;
}void main()
{
showMe("Hello World");
}6. Create your first class MyFirstProject.cpp looks like this:
#include <iostream>
#include <string>using namespace std;
class MyFirstClass
{
public:// Construction
MyFirstClass(const string& Text);// Handling
void showMe();private:
// Attributes
string m_text;
};// Construction
MyFirstClass::MyFirstClass(const string& Text)
{
m_text = Text;
}// Handling
void MyFirstClass::showMe()
{
cout << m_text << endl;
}void main()
{
MyFirstClass MySecondObject("Hello World");MySecondObject.showMe();
}7. Spread your code to different files - Add a header file to your project - Add another source-code file to your project MyFirstProject.cpp looks like this:
#include "MyFirstClass.h"
void main()
{
MyFirstClass MyThirdObject("Hello World");MyThirdObject.showMe();
}MyFirstClass.h looks like this:
#include <string>
using namespace std;
class MyFirstClass
{
public:// Construction
MyFirstClass(const string& Text);// Handling
void showMe();private:
// Attributes
string m_text;
};MyFirstClass.cpp looks like this:
#include "MyFirstClass.h"
#include <iostream>// Construction
MyFirstClass::MyFirstClass(const string& Text)
{
m_text = Text;
}// Han