|
|
Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » How to call the methods of a class from another class
|
|
Re: How to call the methods of a class from another class [message #2280 is a reply to message #2278] |
Wed, 05 April 2006 18:49 ![Go to previous message Go to previous message](theme/default/images/up.png) ![Go to next message Go to next message](theme/default/images/down.png) |
![](https://www.ultimatepp.org/forums/images/custom_avatars/112.jpg) |
forlano
Messages: 1185 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
edifudadmin wrote on Wed, 05 April 2006 18:13 |
Could you post for lazy people at least a few lines of that cry?
Edit: and/or post small testing apps...
|
... sorry, here it is the compiler message and editmask.lay (the cpp file is attached. In it look for the line with
App.UpdateInfo(" from tab1!"); )
It seems the compiler do not see some declaration. I've tried to exchange the relative position of the class but with no positive result.
Luigi
====================== compiler =========================
main2.cpp
C:\MyApps\tabs\main2.cpp: In member function `void Tab1::AddPlayer()':
C:\MyApps\tabs\main2.cpp:94: error: `App' undeclared (first use this function)
C:\MyApps\tabs\main2.cpp:94: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:\MyApps\tabs\main2.cpp: At global scope:
C:\MyApps\tabs\main2.cpp:206: error: `struct App' used prior to declaration
C:\MyApps\tabs\main2.cpp:239: error: `App' has not been declared
C:\MyApps\tabs\main2.cpp: In function `void SubSubMenu(Bar&)':
C:\MyApps\tabs\main2.cpp:241: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:241: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp:241: error: `ShowNumber' undeclared (first use this function)
C:\MyApps\tabs\main2.cpp: At global scope:
C:\MyApps\tabs\main2.cpp:245: error: `App' has not been declared
C:\MyApps\tabs\main2.cpp: In function `void FileMenu(Bar&)':
C:\MyApps\tabs\main2.cpp:246: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:246: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp:246: error: `EnableNumbers' undeclared (first use this function)
C:\MyApps\tabs\main2.cpp:246: error: `numbers_enabled' undeclared (first use this function)
C:\MyApps\tabs\main2.cpp:247: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:247: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp:248: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:248: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp:248: error: `Exit' undeclared (first use this function)
C:\MyApps\tabs\main2.cpp: At global scope:
C:\MyApps\tabs\main2.cpp:253: error: `App' has not been declared
C:\MyApps\tabs\main2.cpp: In function `void EditMenu(Bar&)':
C:\MyApps\tabs\main2.cpp:254: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:254: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp:254: error: `TestEdit' undeclared (first use this function)
C:\MyApps\tabs\main2.cpp:255: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:255: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp:255: error: `Dummy' undeclared (first use this function)
C:\MyApps\tabs\main2.cpp:256: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:256: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp:257: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:257: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp: At global scope:
C:\MyApps\tabs\main2.cpp:261: error: `App' has not been declared
C:\MyApps\tabs\main2.cpp: In function `void HelpMenu(Bar&)':
C:\MyApps\tabs\main2.cpp:263: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:263: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp:263: error: `Dummy' undeclared (first use this function)
C:\MyApps\tabs\main2.cpp:264: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:264: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp: At global scope:
C:\MyApps\tabs\main2.cpp:268: error: `App' has not been declared
C:\MyApps\tabs\main2.cpp: In function `void TopMenus(Bar&)':
C:\MyApps\tabs\main2.cpp:269: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:269: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp:270: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:270: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp:271: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:271: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp: At global scope:
C:\MyApps\tabs\main2.cpp:275: error: `App' has not been declared
C:\MyApps\tabs\main2.cpp:276: error: ISO C++ forbids declaration of `App' with no type
C:\MyApps\tabs\main2.cpp: In function `int App()':
C:\MyApps\tabs\main2.cpp:276: error: `int App()' used prior to declaration
C:\MyApps\tabs\main2.cpp:278: error: `numbers_enabled' undeclared (first use this function)
C:\MyApps\tabs\main2.cpp:279: error: `menu' undeclared (first use this function)
C:\MyApps\tabs\main2.cpp:279: error: `AddFrame' undeclared (first use this function)
C:\MyApps\tabs\main2.cpp:280: error: invalid use of `this' in non-member function
C:\MyApps\tabs\main2.cpp:280: error: `CLASSNAME' has not been declared
C:\MyApps\tabs\main2.cpp:283: error: insufficient contextual information to determine type
C:\MyApps\tabs\main2.cpp:286: error: `status' undeclared (first use this function)
C:\MyApps\tabs\main2.cpp:286: error: `info1' undeclared (first use this function)
C:\MyApps\tabs\main2.cpp: In function `void GuiMainFn_()':
C:\MyApps\tabs\main2.cpp:294: error: `Title' has not been declared
C:\MyApps\tabs\main2.cpp:294: error: request for member of non-aggregate type before '(' token
1 file(s) compiled in (0:07.18) 7188 msec/file
=========================== editmask.lay =================
LAYOUT(Tab1Layout, 704, 368)
ITEM(LabelBox, dv___0, SetLabel(t_("Edit Player")).LeftPosZ(16, 684).TopPosZ(16, 80))
ITEM(Label, dv___1, SetLabel(t_("Name")).SetAlign(ALIGN_CENTER).LeftPosZ(28, 132).TopPosZ(32, 19))
ITEM(Label, dv___2, SetLabel(t_("Fed")).SetAlign(ALIGN_CENTER).LeftPosZ(192, 40).TopPosZ(32, 19))
ITEM(Label, dv___3, SetLabel(t_("Birthday")).SetAlign(ALIGN_CENTER).LeftPosZ(236, 56).TopPosZ(32, 19))
ITEM(Label, dv___4, SetLabel(t_("Gender")).SetAlign(ALIGN_CENTER).LeftPosZ(288, 56).TopPosZ(32, 19))
ITEM(Label, dv___5, SetLabel(t_("Title")).SetAlign(ALIGN_CENTER).LeftPosZ(344, 40).TopPosZ(32, 19))
ITEM(Label, dv___6, SetLabel(t_("ID FIDE")).SetAlign(ALIGN_CENTER).LeftPosZ(396, 48).TopPosZ(32, 19))
ITEM(Label, dv___7, SetLabel(t_("RAT FIDE")).SetAlign(ALIGN_CENTER).LeftPosZ(460, 48).TopPosZ(32, 19))
ITEM(Label, dv___8, SetLabel(t_("ID Nat")).SetAlign(ALIGN_CENTER).LeftPosZ(524, 48).TopPosZ(32, 19))
ITEM(Label, dv___9, SetLabel(t_("Rat Nat")).SetAlign(ALIGN_CENTER).LeftPosZ(584, 48).TopPosZ(32, 19))
ITEM(Label, dv___10, SetLabel(t_("K")).SetAlign(ALIGN_CENTER).LeftPosZ(644, 24).TopPosZ(32, 19))
ITEM(EditString, editName, MaxLen(26).LeftPosZ(28, 160).TopPosZ(56, 19))
ITEM(EditString, editCountry, MaxLen(4).NotNull(true).LeftPosZ(196, 32).TopPosZ(56, 19))
ITEM(EditInt, editNatId, Min(0).Max(99999999).NotNull(true).LeftPosZ(516, 60).TopPosZ(56, 19))
ITEM(EditString, editBirth, MaxLen(11).NotNull(true).LeftPosZ(236, 56).TopPosZ(56, 19))
ITEM(EditInt, editFIDERat, Min(0).Max(9999).NotNull(true).LeftPosZ(460, 48).TopPosZ(56, 19))
ITEM(Option, tsex, SetLabel(t_("Male")).LeftPosZ(300, 42).TopPosZ(56, 20))
ITEM(DropList, editTitle, DisplayAll(true).LeftPosZ(348, 42).TopPosZ(56, 20))
ITEM(EditInt, editFIDEId, Min(0).Max(99999999).NotNull(true).LeftPosZ(396, 56).TopPosZ(56, 19))
ITEM(Button, btnModify, SetLabel(t_("Modify Player")).LeftPosZ(152, 96).TopPosZ(116, 24))
ITEM(EditInt, editNatRat, Min(0).Max(9999).NotNull(true).LeftPosZ(584, 44).TopPosZ(56, 19))
ITEM(EditInt, kcoeff, Min(0).Max(99).NotNull(true).LeftPosZ(648, 24).TopPosZ(56, 19))
ITEM(Button, btnClear, SetLabel(t_("Clear Data")).LeftPosZ(280, 96).TopPosZ(116, 24))
ITEM(Button, btnAdd, SetLabel(t_("Add Player")).LeftPosZ(24, 96).TopPosZ(116, 24))
ITEM(ArrayCtrl, arr, Moving(true).Removing(true).AppendLine(true).LeftPosZ(16, 680).TopPosZ(172, 184))
END_LAYOUT
-
Attachment: main2.cpp
(Size: 8.61KB, Downloaded 1776 times)
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu May 16 08:35:17 CEST 2024
Total time taken to generate the page: 0.02428 seconds
|
|
|