BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

struct var used in a class

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
sam
Guest





PostPosted: Tue Aug 09, 2005 12:18 pm    Post subject: struct var used in a class Reply with quote



NodeImagesProperties is refused by the compiler when using it in a class:
struct tagNodeImagesProperties
{
int ImgFolderIdx;
int ImgFolderSelectIdx;
int ImgDocIdx;
int ImgDocSelectIdx;

}NodeImagesProperties;

class TPanier : public TForm
{
(...)
//REFUSED PAR THE COMPILER
NodeImagesProperties ImgProp;
}

Why ?

Sam


Back to top
Tales Aguiar
Guest





PostPosted: Tue Aug 09, 2005 1:04 pm    Post subject: Re: struct var used in a class Reply with quote




"sam" <skneife3 (AT) wanadoo (DOT) fr> wrote

Quote:
NodeImagesProperties is refused by the compiler when using it in a class:

struct tagNodeImagesProperties
{
int ImgFolderIdx;
int ImgFolderSelectIdx;
int ImgDocIdx;
int ImgDocSelectIdx;

}NodeImagesProperties;

In this code, you declare a type tagNodeImagesProperties and an variable
caled NodeImagesProperties.

try it

type struct tagNodeImagesProperties
{
int ImgFolderIdx;
int ImgFolderSelectIdx;
int ImgDocIdx;
int ImgDocSelectIdx;

}NodeImagesProperties;

Quote:

class TPanier : public TForm
{
(...)
//REFUSED PAR THE COMPILER
NodeImagesProperties ImgProp;
}

Why ?

Sam





Back to top
liz
Guest





PostPosted: Tue Aug 09, 2005 1:21 pm    Post subject: Re: struct var used in a class Reply with quote



On Tue, 9 Aug 2005 14:18:08 +0200, sam wrote:

Quote:
struct tagNodeImagesProperties
{
int ImgFolderIdx;
int ImgFolderSelectIdx;
int ImgDocIdx;
int ImgDocSelectIdx;

}NodeImagesProperties;

NodeImagesProperties is an object of type tagNodeImageProperties.
either use typedef (C-style)

typdef struct tagNodeImagesProperties
{
int ImgFolderIdx;
int ImgFolderSelectIdx;
int ImgDocIdx;
int ImgDocSelectIdx;

}NodeImagesProperties;

Or use NodeImagesProperties instead of the tagNodeImageProperties (C++
style)

struct NodeImagesProperties
{
int ImgFolderIdx;
int ImgFolderSelectIdx;
int ImgDocIdx;
int ImgDocSelectIdx;

};


Quote:
class TPanier : public TForm
{
(...)
//REFUSED PAR THE COMPILER
NodeImagesProperties ImgProp;
}

of course the compiler hated it, effectively you did this:

int Ithing;

class A
{
thing Another;
};

Do as described above

--
Good luck,

liz

Back to top
sam
Guest





PostPosted: Tue Aug 09, 2005 1:47 pm    Post subject: Re: struct var used in a class Reply with quote

Thanbk you for the help and understanding.

Sam
"liz" <lizalbinNotThis (AT) yahoo (DOT) com> a écrit dans le message de
news:vpz4wi9r6qzf$.1czl690vp63n9$.dlg (AT) 40tude (DOT) net...
Quote:
On Tue, 9 Aug 2005 14:18:08 +0200, sam wrote:

struct tagNodeImagesProperties
{
int ImgFolderIdx;
int ImgFolderSelectIdx;
int ImgDocIdx;
int ImgDocSelectIdx;

}NodeImagesProperties;

NodeImagesProperties is an object of type tagNodeImageProperties.
either use typedef (C-style)

typdef struct tagNodeImagesProperties
{
int ImgFolderIdx;
int ImgFolderSelectIdx;
int ImgDocIdx;
int ImgDocSelectIdx;

}NodeImagesProperties;

Or use NodeImagesProperties instead of the tagNodeImageProperties (C++
style)

struct NodeImagesProperties
{
int ImgFolderIdx;
int ImgFolderSelectIdx;
int ImgDocIdx;
int ImgDocSelectIdx;

};


class TPanier : public TForm
{
(...)
//REFUSED PAR THE COMPILER
NodeImagesProperties ImgProp;
}

of course the compiler hated it, effectively you did this:

int Ithing;

class A
{
thing Another;
};

Do as described above

--
Good luck,

liz



Back to top
Liz Albin
Guest





PostPosted: Tue Aug 09, 2005 3:04 pm    Post subject: Re: struct var used in a class Reply with quote

On Tue, 9 Aug 2005 15:47:07 +0200, sam wrote:

Quote:
Thanbk you for the help and understanding.

You're welcome. Please check the following pages for the guidelines
Borland set up for using their news groups:

http://info.borland.com/newsgroups/
http://info.borland.com/newsgroups/guide.html
http://info.borland.com/newsgroups/netiquette.html

One of the netiquette guidelines, indeed the first:

<quote>
1. Keep quoted text to a minimum. When quoting a previous post, edit
out the non-relevant parts of the message. Remove salutations and
signatures. A good rule of thumb is, there should not be more quoted
text than new text.
</quote>

In your case you quoted an entire post, just to say thank you -- and
you top-posted, which is also a no-no.

--
thanks

liz

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.