Home » Community » Newbie corner » THISBACK(function(parameter)) Error C2102
THISBACK(function(parameter)) Error C2102 [message #37688] |
Fri, 02 November 2012 18:05 |
nejnadusho
Messages: 60 Registered: October 2012
|
Member |
|
|
Hi,
I am trying to pass a THISBACK(function(parameter)) and it gives me an error.
int x = 10;
//On click event new user data submition
tab1.userDataButton <<= THISBACK(ClickUserDataButton(x));
Quote: |
C:\MyApps\SeniorProject\Admin.cpp(26) : error C2102: '&' requires l-value
|
If the function does not take parameters it works otherwise it doesn't.
Why?
Thank you very much.
nejnio
|
|
|
Re: THISBACK(function(parameter)) Error C2102 [message #37689 is a reply to message #37688] |
Fri, 02 November 2012 19:48 |
|
Hi nejnio
Thisback take reference to the function, with parameter passed to the function as another parameters to the THISBACK# macro. So it should be called like this:THISBACK(function1)
THISBACK1(function2,123)
THISBACK2(function3,123,"param")
...
I'm not even sure how it could even work for you with the one parameter function Probably its return type was matching something that THISBACK accepts...
Have a look at the reference and example programs, perhaps also reading and trying out the tutorial and figure out how ts might help I understand that some poeple (me included ) prefer to just play with the toolkit and figure out how it works by themselfs, but U++ contains so many unusual concepts and has quite steep learning curve, so following the tutorial and reading the manuals can help (and save you some frustration ).
Best regards,
Honza
|
|
|
Re: THISBACK(function(parameter)) Error C2102 [message #37690 is a reply to message #37688] |
Fri, 02 November 2012 20:33 |
nejnadusho
Messages: 60 Registered: October 2012
|
Member |
|
|
Thank you very much Nonza!
Quote: | Honza wrote on Fri, 02 November 2012 14:48
I'm not even sure how it could even work for you with the one parameter function Probably its return type was matching something that THISBACK accepts...
|
I just want to clarify that it does not work with one or more parameters, in the the way I was trying.
Best,
nejnio
|
|
|
Goto Forum:
Current Time: Sat May 04 13:36:35 CEST 2024
Total time taken to generate the page: 0.02302 seconds
|