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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declared list and struct not recognize in function.

Status
Not open for further replies.

Arowana

Programmer
Feb 22, 2001
19
PT
Hi,
in a program i declared a list and a struct as public in a CDocument.

.....
public:
CPtrlist lista;
struct Socio
{
char nome;
};

At a function in another document when i use :
.....
Socio* pSocio=(Socio*)lista.GetHeadPosition();

lista is not recognize and the struct Socio neather.

What is wrong??

Thank you!
 
Shouldn't it be:

struct Socio
{
char nome;
}Socio;

Instead?

Also, do you include the file using

#include<filename.ext>

??

Post more of your code here.

Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
 
I got the problem!

I declared a struct and a list in a CListDoc class.
And now i want to use them in a function witch is a member function from another class witch is not derived from CListDoc.So when i have:

void declaredclass::function()
{
//if i create a object from CListClass to the use
//the list, the object is not recognize
//the same happens if i want to use a pointer to the
//class
}

so i have problems because the list and struct are not recognize.

Possible solution:declare the list and struct like globals to the application but i don´t know where and how?!!


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top