Best ways to kill Panel and other objects on the panel completely ? - page 3

 
Doerk:

And that´s really a pity. You seem to have good ideas in view of correlation, programming and so on, but MQL4 gives you very tight barriers.

I can only recommend to everybody who is at least able to understand OOP, to reset his brain to basics and to re-learn programming on an OOP basis. OOP, here MQL5, definitely brings you on the next level of programming where you have possibilities that you never can achieve with native programming, at a efficiency which is also so many times higher than with native programming. One who claims it isn´t like that, simply never understood OOP entirely and the power behind it, especially inheritance and virtual overloading, which are THE ultimate keys at all. Just using the standard library is not real OOP programming, but it can be a good start to get into it. MQL5 is simply amazing and it´s 100% compatible with MT4 too.

ono don't get me wrong i do programming in both MQL4 and MQL5, but i prefer to use MQL4.

 
Doerk:

Totally wrong way.  The classes may be buggy, but crash? No. And if there is something with this classes which is really working good, then it is object and memory management. But due to lack of documentation, most people seem to misunderstand how to it all.

@Young - please post the snipped ...


To be honest I got lost in conversation. :)


What I wanted was just a way to kill the existing panel completely.

For example I created the panel using:

m_panel.create ()

Then I want to remove m_panel and want to create totally new panel.

I found that m_panel.delete() method does not remove all the panel components completely.

By looking at the list of object on chart I was able to find that in fact two or three subcomponent of the panel was still there. These cause trouble when I create new panel. Because as far as I know, one can only create one panel class per chart. If there are two panels then they will crash. 

I believe that if people experience the crash with panel it is most likely they have few bits of extra sub components of old panel floating there in the chart. 

You can check this by looking at your list of object on your chart.

I am very sure of this occurance for many buggy code using panels out there.

Kind regards.




 
Young Ho Seo:

To be honest I got lost in conversation. :)


What I wanted was just a way to kill the existing panel completely.

For example I created the panel using:

m_panel.create ()

Then I want to remove m_panel and want to create totally new panel.

I found that m_panel.delete() method does not remove all the panel components completely.

By looking at the list of object on chart I was able to find that in fact two or three subcomponent of the panel was still there. These cause trouble when I create new panel. Because as far as I know, one can only create one panel class per chart. If there are two panels then they will crash. 

I believe that if people experience the crash with panel it is most likely they have few bits of extra sub components of old panel floating there in the chart. 

You can check this by looking at your list of object on your chart.

I am very sure of this occurance for many buggy code using panels out there.

Kind regards.




No prop. The questions are:

1. what is m_panel, an object or a pointer to an object?

2. where is the panel deleted? from a call within the class while its still active or outside?

3. .Delete() is a method of CWndContainer, dont use it for that.

If your m_panel is a pointer, use delete m_panel, then everything is gone. If its an object, use .Destroy() outside the execution code of the class

Reason: