Help with Visual C++ 2008

please help

  • (2 Pages)
  • +
  • 1
  • 2

22 Replies - 1750 Views - Last Post: 15 January 2010 - 02:27 PM Rate Topic: -----

#1 popshot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 13-January 10

Help with Visual C++ 2008

Posted 13 January 2010 - 04:42 PM

OK well i just got microsoft visual c++ 2009 to help for a school project. The code and everything worked at school on visual c++ 2006. I am on windows 7 and when i try to run the program i get an error that say, "cannot open program database '' ". If anyone can help I would appreciate it very much

This post has been edited by popshot: 13 January 2010 - 04:42 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Help with Visual C++ 2008

#2 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3122
  • View blog
  • Posts: 19,167
  • Joined: 14-September 07

Re: Help with Visual C++ 2008

Posted 13 January 2010 - 04:57 PM

There's 2005/2008/2010, there isn't a 2009. In addition, if you want with whatever it is (your post is the definition of ambiguous) you need to provide us an example of what you;'re working with [assuming it's a program issue, not a VS issue]. If it is a VS issue I recommend you go download the express 2008 version so we're all on the same page.
Was This Post Helpful? 0
  • +
  • -

#3 popshot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 13-January 10

Re: Help with Visual C++ 2008

Posted 13 January 2010 - 04:59 PM

View PostKYA, on 13 Jan, 2010 - 03:57 PM, said:

There's 2005/2008/2010, there isn't a 2009. In addition, if you want with whatever it is (your post is the definition of ambiguous) you need to provide us an example of what you;'re working with [assuming it's a program issue, not a VS issue]. If it is a VS issue I recommend you go download the express 2008 version so we're all on the same page.


oh yea thats right im sorry. Its 2008, nd no matter what i code that error comes up. Even a simple hello world program
Was This Post Helpful? 0
  • +
  • -

#4 bodom658  Icon User is offline

  • Villiage Idiom
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,123
  • Joined: 22-February 08

Re: Help with Visual C++ 2008

Posted 13 January 2010 - 04:59 PM

Where did you get MSVS 2009? It doesn't exist! Neither does MSVS 2006...

If you seriously have Microsoft Visual Studio 2009 can you post a pic?

And try reinstalling if you can't open it. Or get MSVC++ 2010 Express

EDIT: Haha, thought so. Try reinstalling or better yet, get the new MSVC++ 2010 express. It rules

This post has been edited by bodom658: 13 January 2010 - 05:00 PM

Was This Post Helpful? 0
  • +
  • -

#5 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6109
  • View blog
  • Posts: 23,666
  • Joined: 23-August 08

Re: Help with Visual C++ 2008

Posted 13 January 2010 - 05:30 PM

You MUST TELL US YOUR ERRORS if you want us to help you!

EDIT: Sorry, I missed that. Possible solution
Was This Post Helpful? 0
  • +
  • -

#6 popshot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 13-January 10

Re: Help with Visual C++ 2008

Posted 13 January 2010 - 07:52 PM

well i downloaded 2010 and its still doing it. I tried almost all your solutions and still nothing
Was This Post Helpful? 0
  • +
  • -

#7 ReclusiveManiac  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 98
  • Joined: 18-September 09

Re: Help with Visual C++ 2008

Posted 13 January 2010 - 11:58 PM

Please post the entire code you are trying to run. Can't troubleshoot without seeing it.
Was This Post Helpful? 0
  • +
  • -

#8 aceofspades686  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 6
  • View blog
  • Posts: 334
  • Joined: 08-October 07

Re: Help with Visual C++ 2008

Posted 14 January 2010 - 12:11 AM

Apparently its caused by a race condition within Visual Studio as well as something specific about the user configuration. At least, that's all I was able to find about the problem.

http://connect.micro...eedbackID=98831
Was This Post Helpful? 0
  • +
  • -

#9 popshot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 13-January 10

Re: Help with Visual C++ 2008

Posted 14 January 2010 - 01:21 PM

View PostReclusiveManiac, on 13 Jan, 2010 - 10:58 PM, said:

Please post the entire code you are trying to run. Can't troubleshoot without seeing it.


ok here is the code for my rpg. quite long so ya


//Text Based RPG
//This program will start a text based rpg
//Ryan Ivany
//November 24 09
//Added variables
//added dagger, wand, and their skill training
//added in three training places
//added monsters in each three training places.
//last date modified, November 24, 09
#include <iostream>
#include <string>
#include <fstream>
#include <windows.h>
#include <time.h>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <stdio.h>
#include <iomanip>
#include <mmsystem.h>
#pragma comment(lib,"Winmm.lib")
using namespace std;

int intName;
int intNameChoice;
int intStatChoice;
int intTownChoice;

string strName;
string strPass;

int intCharChoice;
int intStrength;
int intDexterity;
int intVitality;
int intHealth;

int intGold;
int intPay;
int intWorkHours;


void setcolor(unsigned short color)                 //The function that you'll use to
{                                                   //set the colour
	HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);
	SetConsoleTextAttribute(hcon,color);
}
void cls(){
	COORD coordScreen = { 0, 0 }; 
	DWORD cCharsWritten; 
	CONSOLE_SCREEN_BUFFER_INFO csbi; 
	DWORD dwConSize; 
	HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);  // Handle to stdout

	// Gets the console resolution
	GetConsoleScreenBufferInfo(hConsole, &csbi); 
	dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
	// Fill every cell with spaces
	FillConsoleOutputCharacter(hConsole, TEXT(' '), dwConSize, coordScreen, &cCharsWritten);
	// Fill the console attributes
	FillConsoleOutputAttribute(hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten);
	// Sets the cursor position back to the first row and column
	SetConsoleCursorPosition(hConsole, coordScreen); 
	system("CLS");
}
void Name()
{
	cout << "Do you have a name and password already? " << endl;
	cout << "1. Yes\n2. No" << endl;
	cin >> intNameChoice;

	if (intNameChoice == 1)
	{
		cout << " What was your name? " << endl;
		cin >> strName;
		cout << "Good what was your password? " << endl;
		cin >> strPass;
		cout << "Account Loaded" << endl;
	}


	if (intNameChoice == 2)
	{
		cout << "Time to create your account" << endl;
		cout << "Enter your account name " << endl;
		cin >> strName;
		cout << "Good now enter your password " << endl;
		cin >> strPass;
	}
}

void CreateChar()
{
	for(;;)/>
	{
		cout << "Now would you like to be a\n1. Archer\n2. Paladin\n3. Druid\n" << endl;
		cin >> intCharChoice;

		if (intCharChoice == 1)
		{

			cout << "You choose to be a gracious Archer " << endl;
			cout << "Your stats will be " << endl;
			cout << "Strength = 15\nDexterity = 25\nVitality = 10 " <<endl;
			cout << "Is this ok?\n1. Yes\n2. No " << endl;
			cin >> intStatChoice;
		}

		if (intStatChoice == 1)
		{
			intStrength = 20;
			intDexterity = 25;
			intVitality = 10;
			cout << "Stats are now set\n\n";
			break;
		}
		else if (intStatChoice == 2)
		{
			continue;
		}

		else if (intCharChoice == 2)
		{

			cout << "You choose to be a powerful Paladin " << endl;
			cout << "Your stats will be " << endl;
			cout << "Strength = 25\nDexterity = 10\nVitality = 15 " <<endl;
			cout << "Is this ok?\n1. Yes\n2. No " << endl;
			cin >> intStatChoice;
		}

		if (intStatChoice == 1)
		{
			intStrength = 25;
			intDexterity = 10;
			intVitality = 15;
			cout << "Stats are now set\n\n";
			break;
		}
		else if (intStatChoice == 2)
		{
			continue;
		}

		else if (intCharChoice == 3)
		{

			cout << "You choose to be a cunning Druid " << endl;
			cout << "Your stats will be " << endl;
			cout << "Strength = 15\nDexterity = 25\nVitality = 10 " <<endl;
			cout << "Is this ok?\n1. Yes\n2. No " << endl;
			cin >> intStatChoice;
		}

		if (intStatChoice == 1)
		{
			intStrength = 15;
			intDexterity = 25;
			intVitality = 10;
			cout << "Stats are now set\n\n";
			break;
		}
		else if (intStatChoice == 2)
		{
			continue;
		}
	}

}



int main()


{

	int intWorkHour;

	int intWeapShopChoice;
	int intUpgradeChoice;
	int intBattleChoice;

	int intSwordCost;
	intSwordCost = 0;

	int intBowCost;
	intBowCost = 0;

	int intMaceCost;
	intMaceCost = 0;

	int intSwordLevel;
	intSwordLevel = 1;

	int intBowLevel;
	intBowLevel = 1;

	int intMaceLevel;
	intMaceLevel = 1;

	int intHealth;

	int Sword_Damage = (rand() % 10)  + intSwordLevel;
	int Mace_Damage = (rand() % 13) + + intMaceLevel;
	int Bow_Damage = (rand() % 15) + + intBowLevel;
	int Gobling_Health = 500;
	int Gobling_Damage = 5;
	int Troll_Health = 1000;
	int Troll_Damage = 10;
	int bonus_10 = 10;

	PlaySound("pokecentre.wav", NULL, SND_FILENAME | SND_ASYNC); 

	Name();
	cls();
	CreateChar();
	cls();
	setcolor(14);
	cout << "\t\t\tWelcome To The Kanto Region!\n\n\n";

	setcolor(15);

	{   //Displays users attack, defence, and gold on the screen
		int intHealth = (intVitality) * (25) ;


		for (;;)/>
		{

			cout << "\nHealth: " << intHealth << "\nStrength: " << intStrength <<"\nDexterity: " << intDexterity << "\nGold: " << intGold <<"\n\n";



			//Asks user what they would like to do
			cout << "\n\nWhat would you like to do?\n\n";
			setcolor(10);
			cout << "1 - Work" << endl;
			setcolor(11);
			cout << "2 - Shop" << endl;
			setcolor(13);
			cout << "3 - Battle in Pewter City" << endl;
			setcolor(14);
			cout << "4 - Battle in Vermillion City" << endl;
			setcolor(4);
			cout << "5 - Quit" << endl;

			setcolor(15);

			cin >> intTownChoice;


			if (intTownChoice == 1)
			{
				PlaySound("mountmoon.wav", NULL, SND_FILENAME | SND_ASYNC); 
				//work
				setcolor(10);
				cout << "\n\nHow long would you like to work? (1000 hour maximum) "; //If they choose 1, it will bring them to the work screen where they pick 
				cin >> intWorkHours; //how many hours they work
				intPay = intWorkHours * 100; // gives their money

				if (intWorkHours > 1000)
				{
					cout << "You cant do that ";
					intWorkHours = 1000;
				}

				if (intWorkHours >= 1)
				{
					cout << "\n\nYou worked for " << intWorkHours
						<< " hour(s) and earned " << intPay << " gold piece(s)!\n\n"; //Tells user how long they worked and how much they earned

					intGold += intPay;
					cls();
					PlaySound("pokecentre.wav", NULL, SND_FILENAME | SND_ASYNC);
					continue;

				}
				cls();
				PlaySound("pokecentre.wav", NULL, SND_FILENAME | SND_ASYNC); 
				continue;

			}


			if (intTownChoice == 2)
			{
				intSwordCost = intSwordLevel * 100;
				intBowCost = intBowLevel * 100;
				intMaceCost = intMaceLevel * 100;

				PlaySound("pokegym.wav", NULL, SND_FILENAME | SND_ASYNC); 

				setcolor(11);
				cout << "Welcome to the Shop of Kanto " << endl;
				cout << "Do you need\n1. Sword(Attack:5)\n2. Bow(Attack:10)\n3. Mace(Attack:8)\n4. Leave " <<endl;

				cin >> intUpgradeChoice;
				cls();
				PlaySound("pokegym.wav", NULL, SND_FILENAME | SND_PURGE);

				//This is if they choose to upgrade sword
				if (intUpgradeChoice == 1 && intGold >= intSwordCost)
				{
					intSwordLevel++; //makes sword level up
					cout << "You paid the blacksmith " << intSwordCost
						<< " gold pieces.\nYour sword has been upgraded to level " //Outputs how much they paid + what level their sword goes too
						<< intSwordLevel << "!\n\n";			
					    intGold -= intSwordCost; //Subtracts gold
				}
				if (intUpgradeChoice == 2 && intGold >= intBowCost)
				{
					intBowLevel++; //makes sword level up
					cout << "You paid the blacksmith " << intBowCost
						<< " gold pieces.\nYour bow has been upgraded to level " //Outputs how much they paid + what level their sword goes too
						<< intBowLevel << "!\n\n";
						intGold -= intBowCost; //Subtracts gold
				}
				if (intUpgradeChoice == 3 && intGold >= intMaceCost)
				{
					intMaceLevel++; //makes sword level up
					cout << "You paid the blacksmith " << intMaceCost
						<< " gold pieces.\nYour mace has been upgraded to level " //Outputs how much they paid + what level their sword goes too
						<< intMaceLevel << "!\n\n";
						intGold -= intMaceCost; //Subtracts gold
				}
				if (intUpgradeChoice == 4)
				{
					cls();
					PlaySound("pokecentre.wav", NULL, SND_FILENAME | SND_ASYNC); 
					continue;

				}
				
				PlaySound("pokecentre.wav", NULL, SND_FILENAME | SND_ASYNC); 
				continue;
			}



			if (intTownChoice == 3)
			{
				setcolor(13);

			cout << "You travel to Pewter City...";
			PlaySound("pkmroute1.wav", NULL, SND_FILENAME | SND_ASYNC); 
			Sleep(3000);
			cls();
			cout << "Approaching from the Mist comes a Diglett!\n\n";
			PlaySound("pokebattle.wav", NULL, SND_FILENAME | SND_ASYNC); 
			if (intHealth <= 0)
			{
				cout << "You Died" <<endl;
				PlaySound("pokecentre.wav", NULL, SND_FILENAME | SND_ASYNC);
				continue;
			}

			while (Gobling_Health >= 1)


			{///master while for combat

				srand(static_cast<unsigned int>(time(0)));  

				
				cout<<"your health "<<intHealth<<endl;
				cout<<"the Diglett "<<Gobling_Health<<"\n\n";

				srand(Gobling_Damage);

				Gobling_Damage = (rand() % 5) + 1;

				cout<<"The Diglett did "<<Gobling_Damage<<" Damage"<<endl;

				intHealth = intHealth - Gobling_Damage;


				cout<<"your health "<<intHealth<<endl;
				cout<<"the Diglett "<<Gobling_Health<<"\n\n";


				system("pause");
				


				cout << "What do you want to do\n\n";
				cout << "1: Attack with sword\n2: attack with mace\n3: attack with bow\n4: Run\n";
				cin >> intBattleChoice;
				cls();
				


				int Sword_Damage = (rand() % 10) + intStrength + intSwordLevel;
				int Mace_Damage = (rand() % 13) + intVitality + intMaceLevel;
				int Bow_Damage = (rand() % 15) + intDexterity + intBowLevel;
				
				if (intBattleChoice == 1)	
				{
					Gobling_Damage = (rand() % 5) + 1;   
					Gobling_Health = Gobling_Health - Sword_Damage;
					cout<<"Sword Attack dealed " << Sword_Damage << " Damage! "<<endl;
				}
				if (intBattleChoice == 2)
				{
					Gobling_Damage = (rand() % 5) + 1;   
					Gobling_Health = Gobling_Health - Mace_Damage;
					cout<<"Mace Attack dealed " << Mace_Damage << "Damage" <<endl;
				}
				else if (intBattleChoice == 3)	
				{
					Gobling_Damage = (rand() % 5) + 1;   
					Gobling_Health = Gobling_Health - Bow_Damage;
					cout<<"Bow Attack dealed " << Bow_Damage << " Damage! "<<endl;
				}


				if (intBattleChoice == 4)
				{
					PlaySound("pokecentre.wav", NULL, SND_FILENAME | SND_ASYNC);
					continue;
				}
			}
			

			Gobling_Health = 500;
			intHealth = (intVitality) * (25);
			cls();
			cout << "You Defeated The Diglett";
			PlaySound("pokelevelup.wav", NULL, SND_FILENAME | SND_ASYNC);
			Sleep(3000);
			cls();
			
			PlaySound("pokecentre.wav", NULL, SND_FILENAME | SND_ASYNC);
			continue;


			Gobling_Health = 500;
			intHealth = (intVitality) * (25);
		}
	



		if (intTownChoice == 4)
		{
		setcolor(14);

		cout << "You travel to Vermillion City...";
		PlaySound("pkmroute1.wav", NULL, SND_FILENAME | SND_ASYNC); 
		Sleep(3000);
		cls();
		cout << "Approaching from the Mist comes a Drowsee!\n\n";
		PlaySound("pokebattle.wav", NULL, SND_FILENAME | SND_ASYNC); 
		if (intHealth <= 0)
		{
			cout << "You Died" <<endl;
			PlaySound("pokecentre.wav", NULL, SND_FILENAME | SND_ASYNC);
			continue;
		}

		while (Troll_Health >= 1)


		{///master while for combat

			srand(static_cast<unsigned int>(time(0)));      
			
			cout<<"your health "<<intHealth<<endl;
			cout<<"the Drowsee "<<Troll_Health<<"\n\n";

			srand(Troll_Damage);

			Troll_Damage = (rand() % 10) + 1;

			cout<<"The Drowsee did "<<Troll_Damage<<" Damage"<<endl;

			intHealth = intHealth - Troll_Damage;


			cout<<"your health "<<intHealth<<endl;
			cout<<"the Drowsee "<<Troll_Health<<"\n\n";

			system("pause");
			

			cout << "What do you want to do\n\n";
			cout << "1: Attack with sword\n2: attack with mace\n3: attack with bow\n4: Run\n";
			cin >> intBattleChoice;
			cls();
			

			int Sword_Damage = (rand() % 10) + intStrength + intSwordLevel;
			int Mace_Damage = (rand() % 13) + intVitality + intMaceLevel;
			int Bow_Damage = (rand() % 15) + intDexterity + intBowLevel;
			cls();
			if (intBattleChoice == 1)	
			{
				Troll_Damage = (rand() % 5) + 1;   
				Troll_Health = Troll_Health - Sword_Damage;
				cout<<"Sword Attack dealed " << Sword_Damage << " Damage! "<<endl;
			}
			if (intBattleChoice == 2)
			{
				Troll_Damage = (rand() % 5) + 1;   
				Troll_Health = Troll_Health - Mace_Damage;
				cout<<"Mace Attack dealed " << Mace_Damage << "Damage" <<endl;
			}
			else if (intBattleChoice == 3)	
			{
				Troll_Damage = (rand() % 5) + 1;   
				Troll_Health = Troll_Health - Bow_Damage;
				cout<<"Bow Attack dealed " << Bow_Damage << " Damage! "<<endl;
			}


			if (intBattleChoice == 4)
			{
				PlaySound("pokecentre.wav", NULL, SND_FILENAME | SND_ASYNC);
				continue;
			}
		}

		Troll_Health = 1000;
		intHealth = (intVitality) * (25);
		cls();
		cout << "You Defeated The Drowsee";
		PlaySound("pokelevelup.wav", NULL, SND_FILENAME | SND_ASYNC);
		Sleep(3000);
		cls();

		PlaySound("pokecentre.wav", NULL, SND_FILENAME | SND_ASYNC);
		continue;


		Troll_Health = 1000;
		intHealth = (intVitality) * (25);
	}

		if(intTownChoice == 5)
		{
			break;
		}
		



	system ("PAUSE");
	return 0;

}
}
}


*** MOD EDIT: Added code tags. Please :code: ***

This post has been edited by JackOfAllTrades: 14 January 2010 - 01:23 PM

Was This Post Helpful? 0
  • +
  • -

#10 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6109
  • View blog
  • Posts: 23,666
  • Joined: 23-August 08

Re: Help with Visual C++ 2008

Posted 14 January 2010 - 01:24 PM

Next time you post code, pay attention to all the warnings/request to post using code tags. I fixed this one.

:code:

Where did you create your project on the hard drive? Is it under your documents folders?
Was This Post Helpful? 0
  • +
  • -

#11 ReclusiveManiac  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 98
  • Joined: 18-September 09

Re: Help with Visual C++ 2008

Posted 14 January 2010 - 03:38 PM

I am guessing it is a problem with one of the headers? Did you say you got this to compile with Visual Studio on a different computer? But with the same Visual Studio version?
Was This Post Helpful? 0
  • +
  • -

#12 popshot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 13-January 10

Re: Help with Visual C++ 2008

Posted 14 January 2010 - 04:58 PM

View PostReclusiveManiac, on 14 Jan, 2010 - 02:38 PM, said:

I am guessing it is a problem with one of the headers? Did you say you got this to compile with Visual Studio on a different computer? But with the same Visual Studio version?


no in school we use windows xp and visual c++ 2006. I got it to work there fine but when i brought it to my vista on visual c++ 2008 or 2010 it wont work
Was This Post Helpful? 0
  • +
  • -

#13 popshot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 13-January 10

Re: Help with Visual C++ 2008

Posted 14 January 2010 - 05:13 PM

View PostJackOfAllTrades, on 14 Jan, 2010 - 12:24 PM, said:

Next time you post code, pay attention to all the warnings/request to post using code tags. I fixed this one.

:code:

Where did you create your project on the hard drive? Is it under your documents folders?


oh its running from my documents
Was This Post Helpful? 0
  • +
  • -

#14 popshot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 13-January 10

Re: Help with Visual C++ 2008

Posted 14 January 2010 - 08:36 PM

can anyone think of a solution?
Was This Post Helpful? 0
  • +
  • -

#15 ReclusiveManiac  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 98
  • Joined: 18-September 09

Re: Help with Visual C++ 2008

Posted 14 January 2010 - 10:46 PM

My best guess is that it can't find the headers or something...I really don't know though...

Not sure if this is the problem or not, but I know #pragma is depreceated and I didn't recognize what that command did in your program.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2