Click here to Skip to main content
15,742,011 members

Comments by Menci Lucio (Top 19 by date)

Menci Lucio 19-Dec-19 4:46am View    
Yes, of course, you are in right. After a lot of headaches caused by my wrong choice, I build my project from 0 using some command classes.
I'm a newbie about c++, I'm writing in C# and I was wondering if there is a way to make something like events. But C++ is not c#. Maybe C# events was made by command pattern...

Thank you
Menci Lucio 17-Dec-19 3:49am View    
The point is not this one. The point is that I'd like to not define them in the base class... I think that if I don't find an elegant solution I will define all methods in the base class as not abstract ones.
Menci Lucio 17-Dec-19 3:44am View    
Hi, thank you, but if I don't want to use virtual methods and override them there are some reasons. I have a lot of subclasses of the BaseClass in my production project, for example, there are led lights (the virtual methods has to be switchOn, switchOff, switchState, startTimer, blink, blinkFast), serialQueue (sendLocalMessage, sendGlobal, sendARequest), display (showState, switchOff, showError), and many others. I tried to define all virtual methods in the base class, but all of them has to be defined into derived ones (see the code I posted).

The last but not least reason is I'd like to know if there is a way to do that, for personal knowledge, and for pride :-)
Menci Lucio 16-Dec-19 12:33pm View    
This is what I had trying to do, but I was not able to use the function pointer defined in the base class to define a function in the derived class:
the line
fx add = &Derived::_add;
returned the error
error: cannot convert 'int (Derived::*)()' to 'BaseData::fx {aka int (BaseData::*)()}' in initialization

This was the result of my headache :-)
Menci Lucio 29-Oct-18 13:29pm View    
Found! (maremmamaiala) The content of the file didn't reflect the extension. I don't remember what I did into the old PC. I opened the file running as not administrator, SaveAs specifyng the file type, now Excel right opens the file.