Board index » cppbuilder » Enum question
Jean Grey
![]() CBuilder Developer |
Jean Grey
![]() CBuilder Developer |
Enum question2003-12-04 07:10:51 AM cppbuilder90 with regards to the post "The trouble with enum and ints" ... does someone here know why we have to check "Treat enums as int" to get the correct enum value when converting a vcl to activex? it's just that even if i assign values to the enum, BCB still doesn't recognize it. someone pls explain the behavior of enums in BCB ... thanks. |
sam
![]() CBuilder Developer |
2005-08-09 05:58:05 PM
Re:Enum question
How accessing an enum varaiable from another class:
class TNodeProperties : public TObject { enum TypeNoeud{FOLDER=0,DOCUMENT}; TypeNoeud TypeNode; AnsiString ItemTitle; }; void __fastcall TForm1::Button1Click(TObject *Sender) { TNodeProperties *pNodeProp=new TNodeProperties(); //*ERROR: FOLDER is unknown here by the compiler* pNodeProp->TypeNode=FOLDER; //----------------------------------------------------------- } What I need to do for assign the value FOLDER to pNodeProp->TypeNode ? Sam |
liz
![]() CBuilder Developer |
2005-08-09 06:27:12 PM
Re:Enum question
On Tue, 9 Aug 2005 11:58:05 +0200, sam wrote:
Quote//*ERROR: FOLDER is unknown here by the compiler* -- liz {smallsort} |
Muzaffar Mahkamov
![]() CBuilder Developer |
2005-08-09 06:53:33 PM
Re:Enum question
sam wrote:
QuoteHow accessing an enum varaiable from another class: { public: enum TypeNoeud{FOLDER=0,DOCUMENT}; } Quotevoid __fastcall TForm1::Button1Click(TObject *Sender) { TNodeProperties *pNodeProp=new TNodeProperties(); pNodeProp->TypeNode=TNodeProperties::FOLDER; } |
sam
![]() CBuilder Developer |
2005-08-09 07:36:02 PM
Re:Enum question
Thank you very much for resolving my mistake.
Sam "Muzaffar Mahkamov" < XXXX@XXXXX.COM >a écrit dans le message de Quotesam wrote: |