cannot call member function

Login to reply to this topic.
Wed, 2003-09-10 12:45
Joined: 2003-09-08
Forum posts: 15
Hi,

I have another question.
When trying to compile my code I get the following message
cannot call member function 'Cp800_gps::read(TDes8 &)' without object

I call the method the following way
Code:
int status = read( iReadBuffer );

Where the method is
Code:
int read( TDes8& iReadBuffer )

Both methods reside within the same class

I use the following part of the header file
Code:
private:    
int read( TDes8& iReadBuffer );
};

What am I doing wrong?
Thanks in advance
Alex

Wed, 2003-09-10 13:19
Joined: 2003-08-20
Forum posts: 15
cannot call member function
How are you defining iReadBuffer? Does it point to a properly prepared section of memory and so forth?

Gareth Poulton

Wed, 2003-09-10 13:21
Joined: 2003-09-08
Forum posts: 15
cannot call member function
iReadBuffer is defined like this:

Code:
TBuf8<bufSize> iReadBuffer;

I think it must have something to do with the way I try to call the method
Wed, 2003-09-10 14:12
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2029
cannot call member function
You should write:
Code:
int yourObject::read( TDes8& iReadBuffer )
{
}

rather than

Code:
int read( TDes8& iReadBuffer )
{
}

Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Wed, 2003-09-10 14:27
Joined: 2003-09-08
Forum posts: 15
cannot call member function
Thanks that did help me with a part of my problem.

I also had to change the way I access my class. Earlier I did it by using static access.

Now I changed it to creating an new object and than access the methods of this object.

Thanks for your help!
Tongue
  • Login to reply to this topic.