Access function of View class
Hi,
I want to access a member function of a view class from a custom class.
I have declare my view class a friend class of the custom class:
friend class CTestView;
In my custom class, I have a member function in wich I want to access a member function of my view class:
void Calcul_Int (CTestView pView)
{
int nombre;
nombre = pView->GetInt();
}
In my view class, I have:
CMyClass result;
CTestView* pView;
pView = this;
result.Calcul_Int(pView);
I can compile this code. I get the error message:
error C2664: 'Calcul_Int' : cannot convert parameter 1 from 'class CTestView *' to 'class CTestView'.
Can anyone give me some hints?
Thanks
Claude Gagnon
Re: Access function of View class
You're missing the * int the method
void Calcul_Int (CTestView* pView)
{
int nombre;
nombre = pView->GetInt();
}
Re: Access function of View class
Thanks for your help,
Unfortunately that's not working.
I receive the following error message :
error LNK2001: unresolved external symbol "public: void __thiscall CMyClass::Calcul_Int(class CTestView *)" (?Calcul_Int@CMyClass@@QAEXPAVCTestView@@@Z)
If you have some hints, I will appreciate.
Claude GAgnon
Re: Access function of View class
Have you made this change both to the class definition (.h) and the
implementation (.cpp)? If not, the compiler error makes sense