Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Problem in function call

1 replies · 1,412 views · Started 02 September 2003

Dear all,

I got a problem in a member function call across classes.
I have the following class

class MyController:CBase()
{
//various declarations
...
public:
CDesC16ArrayFlat* InstalledProfiles();
private:
CDesC16ArrayFlat* iProfiles; //created in the constructor of the class
};

InstalledProfiles() is implemented as follows:
CDesC16ArrayFlat* MyController::InstalledProfiles
{
return iProfiles;
}

In another class, holding a pointer to an object of type MyController,I do
the following:
CDesC16ArrayFlat* MyPtr = iController->InstalledProfiles();

When compiling, I get the following error in the last line, i.e. where i call the InstalledProfiles function():
Cannot pass const/volatle data object to non-const/volatile member
functions.
Any clue what this means?

Regards,
Marco

Ok, maybe I solved the issue...
The iController member was declared as a const member and assigned in the constructor by a const parameter. It seems working fine by removing the const specifier.

/Marco