Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ClassView problem

Status
Not open for further replies.

michaelkrauklis

Programmer
Dec 5, 2001
226
US
Ok, I've gotta a problem being that one of the classes in my project doesn't show up in the ClassView frame. If you select the FileView frame the .cpp and the .h files are both there and I can edit them without problems. But when I compile my program I get errors such as:


d:\paradoxtest\mike\paradoxtosql\paradoxtosql.cpp(84) : error C2248: 'new' : cannot access public member declared in class 'CObject'
d:\program files\microsoft visual studio\vc98\mfc\include\afx.h(683) : see declaration of 'new'
d:\paradoxtest\mike\paradoxtosql\paradoxtosql.cpp(84) : error C2248: 'delete' : cannot access public member declared in class 'CObject'
d:\program files\microsoft visual studio\vc98\mfc\include\afx.h(685) : see declaration of 'delete'
d:\paradoxtest\mike\paradoxtosql\paradoxtosql.cpp(84) : error C2243: 'type cast' : conversion from 'class Type *' to 'class CObject *' exists, but is inaccessible
d:\paradoxtest\mike\paradoxtosql\paradoxtosql.cpp(85) : error C2248: 'new' : cannot access public member declared in class 'CObject'


I don't know if the ClassView problem is related to the errors I'm getting or what. The structure of the class is very similar to the structure of another class I created that worked. I can't seem to figure out what's wrong. Here is the .h for the class that doesn't seem to be working correctly.



Code:
#ifndef TYPE_H
#define TYPE_H

#include <afxcoll.h>
#include <afx.h>

class Type : CObject {

public:
	Type(CString *name,CString *precision,bool scale,bool text);
	~Type();
	CString* getName();
	CString* getPrecision();
	bool isScale();
	bool isText();

private:
	CString *name;
	CString *precision;
	bool scale;
	bool text;
};
#endif


If anyone can see any errors I might have made I would greatly appreciate a response. I'm stuck. Thanks. MYenigmaSELF
myenigmaself@yahoo.com
 
Well scratch that problem. I forgot to make the inheritance public:

class Type : pubilc CObject{

That fixed all my errors. The class still isn't showing up in the ClassView frame but I guess that's not a big deal. Just annoying. If anyone know's what's up with that give me a shout out, but like I said, it's no big deal. Thanks! MYenigmaSELF
myenigmaself@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top