Barry wrote:
> Neviton wrote:
>> Help with this error ! Please !
>> The code below is simplified, because I'm trying to solve this error.
>>
>> ...MyClass.cpp In member function `void MyClass::Initialize()':
>> ...MyClass.cpp aggregate value used where an integer was expected
>> ...Makefile.win [Build Error] [MyClass.o] Error 1
>>
>> The code:
>>
>> /* MyClass.h *****************/
>> class MyClass
>> {
>> public:
>> void Initialize();
>> void MyFunction();
>> };
>>
>> /* MyClass.cpp **************/
>> #include "MyClass.h"
>> void MyClass::Initialize()
>> {
>> long address = (long)MyFunction; //this line rises the error
>
> MyFunction is member function, not function
>
> void MyClass::*pmf = &MyClass::MyFunction;
Sorry, what a impulsive man I am! deal too much with pointer to member
recently
void (MyClass::*pmf)() = &MyClass::MyFunction;
>
> Moreover, casting a function pointer to other type is meaningless.
>
>
>> }
>>
>> void MyClass::MyFunction()
>> {
>> //empty
>> }
>>
>
>
--
Thanks
Barry