Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » THISBACK and function-overloading
THISBACK and function-overloading [message #17024] |
Fri, 25 July 2008 11:29 |
|
michael
Messages: 153 Registered: May 2007 Location: Germany
|
Experienced Member |
|
|
I'm using overloaded functions:
void ViewHistory()
{
some code
}
void ViewHistory(String conditions)
{
some other code
}
I'm calling this function by using THISBACK like this:
bar.Add("Aufwahlhistorie", ImgMainWnd::history(), THISBACK(ViewHistory)).Key(K_ALT_A).Help("Aufwahlhistorie").Enable(true);
Before i used overloading all went fine, since i'm using this overloaded function i got the following compile-error:
K:\Entwicklung\UPP\prohibisZA\prohibisZA.cpp(734) : error C2668: 'Upp::callback' : ambiguous call to overloaded function
c:\upp\uppsrc\core\Cbgen.h(229): could be 'Upp::Callback1<P1> Upp::callback<prohibisZA,prohibisZA,Upp::String>(OBJECT *,void (__th
iscall prohibisZA::* )(P1))'
with
[
P1=Upp::String,
OBJECT=prohibisZA
]
c:\upp\uppsrc\core\Cbgen.h(80): or 'Upp::Callback Upp::callback<prohibisZA,prohibisZA>(OBJECT *,void (__thiscall prohibisZA:
:* )(void))'
with
[
OBJECT=prohibisZA
]
while trying to match the argument list '(prohibisZA *const , overloaded-function)'
K:\Entwicklung\UPP\prohibisZA\prohibisZA.cpp(734) : error C2228: left of '.Key' must have class/struct/union
K:\Entwicklung\UPP\prohibisZA\prohibisZA.cpp(734) : error C2228: left of '.Help' must have class/struct/union
K:\Entwicklung\UPP\prohibisZA\prohibisZA.cpp(734) : error C2228: left of '.Enable' must have class/struct/union
How do i use THISBACK when using function-overloading?
|
|
|
Goto Forum:
Current Time: Tue Apr 23 19:43:19 CEST 2024
Total time taken to generate the page: 0.01961 seconds
|