 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
sam Guest
|
Posted: Tue Aug 09, 2005 12:18 pm Post subject: struct var used in a class |
|
|
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
|
Posted: Tue Aug 09, 2005 1:04 pm Post subject: Re: struct var used in a class |
|
|
"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
|
Posted: Tue Aug 09, 2005 1:21 pm Post subject: Re: struct var used in a class |
|
|
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
|
Posted: Tue Aug 09, 2005 1:47 pm Post subject: Re: struct var used in a class |
|
|
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
|
Posted: Tue Aug 09, 2005 3:04 pm Post subject: Re: struct var used in a class |
|
|
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 |
|
 |
|
|
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
|
|