32 views
in GUI Development by

Hi,

I am having a class. In that there are two variables, one is bitmap type and another one is string type. 

I am using that class as object in a method. and stores the string in that object. then trying to return that object which has stored string and null bitmap(by default) in it.

In the function call returning, I am using local object in that class to get the returned value. but I am facing this error. couldn't get much insight about it.

Note : object storing string value and local object in another class which is going to store returned object is of same class type (Application::alt_prop_cls)

 

Thank you,

Meenakshi Sundaram S R.

1 Answer

0 votes
by

Hello Meenakshi Sundaram S R.,

In the function call returning, I am using local object in that class to get the returned value. but I am facing this error. couldn't get much insight about it.

Without knowing the source code it is difficult to deduce the cause of the error. The message indicates literally an 'invalid assignment'. Please check the operand left to the assignment operator.

Best regards

Paul Banach

by

Hi Paul,

I have attached the code screenshots for your reference.

 

In Application::alt_prop_cls, two variables are there


The Application::alt_prop_cls object is used in a class, recursive_check() function. saving the string and returning that object in that function.

 

The object of Application::alt_prop_cls is used in another class. In this class, update_data() function invoking recursive check method in different class,

that method should return Application::alt_prop_cls type, it is not assigning to the alt_prop_cls in line 20. throwing invalid assignment error.

 

Need to know why this occurs and how to overcome this error.

 

Thank you,

Meenakshi Sundaram S R.

by

Have you changed the implementation in the meantime? I'm asking that because according to the error message, the error should be found in line 15 inside the method Application::alt_text_bhvr_cls.recursive_check(). From the above screenshots the method ends with line 3.

Nevertheless, in the last screenshot in line 20 you assign a value to an object. This is an error. The object exists already. You can change the content of the object by accessing and modifying its variables/properties. The object itself can't be replaced by other object. This explains the error message. The operand on the left of the assignment operator can#T receive a value.

If you want to store an object, which later is replaced by other object, use variable:

1. Select and delete alt_prop_clss.

2. Add a new variable member.

3. Name the variable member alt_prop_clss.

4. Configure the type of the variable to be Application::alt_prop_cls.

Please note, as long as the variable is not explicitly initialized, it will contain null. That means 'null-object'. You can initialize the variable with new Application::alt_prop_cls then it will refer a valid object . Later when you assign a new object to the variable, the old object will be freed and new object will be stored in the variable.

I hope it helps you further.

bnest regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...