2 Replies - 1191 Views - Last Post: 12 October 2006 - 05:43 PM Rate Topic: -----

#1 Vextor  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 313
  • Joined: 22-May 02

Inheritence bug in Visual Studio 2k5?

Posted 12 October 2006 - 04:32 PM

Ok. I'm not sure why i'm having this problem. I may need to turn an option on or something. My problem is this...

I have a class LineObject which is being inherited by a class LineItemNode, as requsted by my instructor. All the child class is supposed to do is add the functionality of being placed in a custom linked list. But for some reason the class methods aren't accessible by the child class. I don't understand why, what am I doing wrong?


LineObject.h
#ifndef LineObject_H
#define LineObject_H
#include <string>

using namespace std;

class LineObject
{
	public:
		
		LineObject();				 
		LineObject(LineObject & lo); // Copy Constructor
		LineObject(string i_makeModel, string i_driverName, int i_bhp, int i_class, double i_carValue, bool i_nos, bool i_slk);


		/* Set functions to set data individually */
		void set_MakeMdlDriver(string i_makeModel, string i_driverName);
		void set_BHPClass(int i_bhp, int i_class);
		void set_CarValue(double i_carValue);
		void set_NosSlk(bool i_nos, bool i_slk);	
		void set_All(string i_makeModel, string i_driverName, int i_bhp, int i_class, double i_carValue, bool i_nos, bool i_slk);

		/* Displays object data to screen */
		void DisplayObjectData();

		/* Get functions to get data from class */
	int get_bhp()		{return	bhp;}
	int get_raceClass()		{return raceClass;}
	double get_carValue()		{return carValue;}
	string get_makeModel()	{return makeModel;}
	string get_driverName()	{return driverName;}
	bool get_NOS()		{return nos_Installed;}
	bool get_SLK()		{return slk_Installed;}


		/*Overloaded Operators*/
		bool operator > (LineObject elem);
		bool operator > (LineObject *elem);
		
		bool operator < (LineObject elem);
		bool operator < (LineObject *elem);

		bool operator == (LineObject elem);

	protected:	
		string makeModel;
		string driverName;
		
		int bhp;
		int raceClass;
		double carValue;
		
		bool nos_Installed; //Nitros systems are included in many performance cars.
		bool slk_Installed; //Slicks are a type of tire used on racing vehicles to increase performance.
};

#endif



LineItemNode.h
#ifndef LINODE_H
#define LINODE_H

#include "LineObject.h"
using namespace std;

class LineItemNode : public LineObject
{
	private:
		LineItemNode *next;
		LineItemNode *prev;


	public:

		LineItemNode();

};

#endif



Let me know if you need anything else. Does anyone know if there is an option in VS2005 that 'hides' parent class methods for some reason?

Is This A Good Question/Topic? 0
  • +

Replies To: Inheritence bug in Visual Studio 2k5?

#2 Vextor  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 313
  • Joined: 22-May 02

Re: Inheritence bug in Visual Studio 2k5?

Posted 12 October 2006 - 05:33 PM

Well I don't have any sort of clue what was wrong but I re-created the solution, copied the files and rewrote the child class and it's working like a charm now. Sheesh. :angry:
Was This Post Helpful? 0
  • +
  • -

#3 Mrafcho001  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 41
  • View blog
  • Posts: 769
  • Joined: 01-November 05

Re: Inheritence bug in Visual Studio 2k5?

Posted 12 October 2006 - 05:43 PM

Its the intellisence.

You need to close VS, delete the intelisence file created by VS, and restart VS
should work just fine then..
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1