CAppDialog in Expert Advisors - terminal freezing after closing - page 2

To add comments, please log in or register
Peter Vorobyev
350
Peter Vorobyev  
Mohammad Hossein Sadeghi:

I believe the best way is to create an instance of the class by 'new' keyword, define a pointer in global scope, create an instance of it in OnInit() by 'new' keyword and assign it to the pointer, then delete it in OnDeinit(), it is well described in the following post:

https://www.mql5.com/en/forum/64619/page2#comment_2052954

Another work around would be setting 'm_deinit_reason' to WRONG_VALUE by overriding CAppDialog::Create function virtually, since it is a public method of the class and it is the only function that calls CreateCommon, and then use the new derived class instead.

Mohammad, a great solution. There is one question. How to access the methods of the created instance of the object in the body of the CMyAppDialog :: Create procedure?

What is the syntax?

12
To add comments, please log in or register