PDA

View Full Version : term does not evaluate to a function



:db:sStrong
18th April 2007, 10:09
Hi all

I get an error which says: term does not evaluate to a function
the following is my constructor


CIm::CIm(QString filename, QWidget * p, const char * n, CV *Vi, WFlags f ) : ImBase( p, n ), m_Vi( Vi )
and the error occours on following twee lines:


FileA = &(Vi()->getFileA());
FileB = &(Vi()->getFileB());

if ( FileA)
{
//
}
if ( FileB )
{
//
}
can someone help me?
thanks in advance

aamer4yu
18th April 2007, 10:12
how are FileA and FileB declared ??
it seems u are using some function name without the brackets() ....

wysota
18th April 2007, 10:13
"Vi" is not a function (it's a variable) and you call it as such.

:db:sStrong
18th April 2007, 10:22
how are FileA and FileB declared ??
it seems u are using some function name without the brackets() ....




CFileA * FileA;
CFileB * FileB;



and if i remove this these two line i do not get a compiler error..




FileA = &(Vi()->getFileA());

FileB = &(Vi()->getFileB());


@wysota

Vi is a function ans is made as such


CVi *Vi() { return m_Vi; }

wysota
18th April 2007, 10:26
No, it's not. You have a parameter "CV *Vi" in the constructor that shadows the function. Change the argument name.

:db:sStrong
18th April 2007, 10:47
@Wyosta
I cant change that argument because CV is a class and i assign a pointer
to CV class and thats why it is "CV* Vi"

:db:sStrong
18th April 2007, 10:54
No, it's not. You have a parameter "CV *Vi" in the constructor that shadows the function. Change the argument name.

my mistake i got it u were right i change the name and it works