Jump to content
  • Advertisement
Sign in to follow this  
bionic_atom

I switched to VC++ but im confused now.

This topic is 4250 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK, I currently just switched to Visual C++ latest 05 Express edition, for I was getting tired of the SDL not working with codeblock or whatever the heck I was using, and was told VC++ is so much easier. What a load of crap. I had to reconfigure the App.htm, corewin_express.vsprops file not to mention the directories just to start building a window application after spending 5 hours + on a BellSouth DSL line downloading and installing the VC++ and Platform SDK to come to realize that all the C++ I have learned in the past 2 weeks doesn't even work in it. How come? If it's C++ like it says on it's fancy microsoft logo, title, window, etc... it should use the C++ language but i go and use cout<< and do the using name space std; and some other stuff to start building some small stuff to see if it works, and it doesn't recognize any of it. how come? I wanted to be a game developer and still do, but im just frustrated with learning all these different languages if they are suppose to be the same. I looked up with reference in a console window I use printf("statement string"); but how do I pause it? it's certainly not System("PAUSE"); or System.pause; I tried all different combos but wasn't satisfied. Well im going to bed now, but just curious since Im going to have to learn C++ for being a game developer and the most of em use this V C++ how can I learn this language? I honestly thought I have already learned it with Dev C++, and Codeblocks, and my books I have but no code I had would work. Please direct me in the right path. And as always I appreciate the readers who actually finish my frustrated messages. Until then... Take Care! c.s. finch

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by bionic_atom
I had to reconfigure the App.htm, corewin_express.vsprops file not to mention the directories just to start building a window application after spending 5 hours + on a BellSouth DSL line downloading and installing the VC++ and Platform SDK to come to realize that all the C++ I have learned in the past 2 weeks doesn't even work in it.

Had to reconfigure? I've never even heard of those files. What do you mean you had to reconfigure them and what lead you to believe this?

What was the exact code you tried to compile and what were the errors it gave you?

Share this post


Link to post
Share on other sites
Quote:
Original post by Colin Jeanne
Quote:
Original post by bionic_atom
I had to reconfigure the App.htm, corewin_express.vsprops file not to mention the directories just to start building a window application after spending 5 hours + on a BellSouth DSL line downloading and installing the VC++ and Platform SDK to come to realize that all the C++ I have learned in the past 2 weeks doesn't even work in it.

Had to reconfigure? I've never even heard of those files. What do you mean you had to reconfigure them and what lead you to believe this?

What was the exact code you tried to compile and what were the errors it gave you?


Sorry, I probably should of explained a little more. http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ is where I got the link and it's where I downloaded the stuff. It said and I quote "In order to use Visual C++ Express to build Win32 applications, you'll need to take just a few more steps" Please forgive me but a few steps my ass for Win32 Apps. But i actually figured all that out OK, but im still frustrated much with the whole language linguistik? C++ definition it has. I can't use the code i've been learning in C++ for the past 2 weeks in a console app how come? for instance I tried

#include <iostream>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>

const int SIZE = 100;

struct inv_type {
char item[40];
double cost;
double retail;
int on_hand;
int lead_time;
} invtry[SIZE];

void enter(), init_list(), display();
void update(), input(int i);
int menu();
using namespace std;


struct
{
char item[40]; //name of item
double cost; //cost
double retail; //retail price
int on_hand; //amount on hand
int lead_time; //number of days before resupply
}temp;


int main()
{
char choice;

init_list();

for(;;)
{
choice = menu();
switch(choice)
{
case 'e': enter();
break;
case 'd': display();
break;
case 'u': update();
break;
case 'g': return 0;
}
}
}

//Initialize the inv_type_info array.
void init_list()
{
int t;

for(t=0; t<SIZE; t++) *invtry[t].item = '\0';
}

//Get a menu selection
int menu()
{
char ch;
init_list();

cout << "\n";
do
{
cout<<"(E)nter\n";
cout<<"(D)isplay\n";
cout<<"(U)pdate\n";
cout<<"(Q)uit\n\n";
cout<<"Choose one: ";
cin >> ch;
}while(!strchr("eduq", tolower(ch)));
return tolower(ch);
}

//Enter items into the list
void enter()
{
int i;
for(i=0; i<SIZE; i++)
if(!*invtry.item) break;

if(i==SIZE)
{
cout <<"List full\n";
return;
}
input(i);
}

void input(int i)
{
char str[80];
cout<<"Item: ";
cin >> invtry.item;

cout<<"Cost: ";
cin>>invtry.cost;

cout<<"Retail Price: ";
cin>>invtry.retail;

cout<<"On hand: ";
cin>>invtry.on_hand;

cout<<"Lead time to resupply (in days): ";
cin>>invtry.lead_time;
}

//Modify an existing item.
void update()
{
int i;
char name[80];

cout<<"Enter item: ";
cin>>name;

for(i=0; i<SIZE; i++)
if(!strcmp(name, invtry.item)) break;

if(i==SIZE){
cout<<"Item not found\n";
return;
}

cout<<"Enter new information.\n";
input(i);
}

//Display the list.
void display()
{
int t;
for(t=0; t<SIZE; t++){
if(*invtry[t].item){
cout<<invtry[t].item<< "\n";
cout<<"Cost: "<<invtry[t].cost;
cout<<"\nRetail: ";
cout<<invtry[t].retail<<"\n";
cout<<"On hands: "<<invtry[t].on_hand;
cout<<"\nResupply time: ";
cout<<invtry[t].lead_time<<" days\n\n";
}
}
}


which is a very simple program that I made in Dev C++ and later threw in Codeblocks since I switched editors but it worked fine in both C++ editors, but when I threw it in Visual C++ it didn't. So, I started simpler I did a simple Hello world console base stuff. But it still said it had building errors. Why is this?

Share this post


Link to post
Share on other sites
The sample program you posted compiled and ran for me using Visual C++ Express. (I tried it as a "Win32 Console Application" with precompiled headers disabled.)

Could you list some of the errors you were getting when you tried it?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by bionic_atom
OK, I currently just switched to Visual C++ latest 05 Express edition, for I was getting tired of the SDL not working with codeblock or whatever the heck I was using, and was told VC++ is so much easier. What a load of crap. I had to reconfigure the App.htm, corewin_express.vsprops file not to mention the directories just to start building a window application


I admit this is a minor annoyance, but look on the bright side - now that you've configured it once you won't have to do it again.

Original post by bionic_atom
all the C++ I have learned in the past 2 weeks doesn't even work in it. How come? If it's C++ like it says on it's fancy microsoft logo, title, window, etc... it should use the C++ language but i go and use cout<

Share this post


Link to post
Share on other sites
To make a simple console application you don't need to hand edit those files. Also, when creating your project did you choose Win32->Console Application? If you choose CLR Console Applications, there will be problems, and it is an easy mistake to make. Also when making a simple project, I would go into the Application Settings options (while creating the project) and check "Empty project."

Share this post


Link to post
Share on other sites
Thanks for the advice. Problem was in the project options precompiled headers. Now I just need to figure out how to do a system pause thing. thanks for the help.

Share this post


Link to post
Share on other sites
If you mean this...

system("PAUSE");

It works, but it's not the best option. I'll let someone else tell the best because i honestly don't know it. And it also depends on the context in which you need the pause.

btw. If the pause is just so you can debug and view output at the end of your program execution, visual studio automatically adds it in if you run the program in debug mode.

Share this post


Link to post
Share on other sites
You not really learning a new language just an IDE which is the Development environment (simplly put the app yo are working with). After you get use to every thing trust me you would be loving it. It is packed with extra feature not present in other IDE like code block. Just look at the samples from microsoft and everything should be okay.


[edit]

yeah it really blows that you have to download the psdk just for win32 development they should have something lite to download since some might not need all of it PLUS having the broken MFC really made me mad beacuase I see it there and thought i could learn it too but low and behold it doesn't work. bummer but over all its still worth the update

Share this post


Link to post
Share on other sites
To stop the window from closing at the end of the program, either:
  • Start without debugging (Ctrl+F5), or;
  • Set a breakpoint on the closing brace of the program.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!