Discussion of article "Developing graphical interfaces for Expert Advisors and indicators based on .Net Framework and C#" - page 2

 

was anybody able to figure out why there is below error?

The MQL compiler states : "Undeclared Identifier" for any of the enumerations down below.

I am also getting same error.

 
sachnyc:

was anybody able to figure out why there is below error?

The MQL compiler states : "Undeclared Identifier" for any of the enumerations down below.

I am also getting same error.

You can use the numeric representation of each Event Type:

Event Type ID
Exception 0
ClickOnElement 1
TextChange 2
ScrollChange 3

Here is an example with SendEvent Function (This code is from TardePanel EA):

GuiController::SendEvent("CurrentVolume", TextChange, 0, 0.0, corr_vol);
GuiController::SendEvent("CurrentVolume", 2, 0, 0.0, corr_vol);

You change the representation of the event TextChange for its ID which is 2, and you do this for all the function that need it.

 
Artur Zas:

The code in the example is WinForms specific, but you can easily alter it for use with WPF. You just need to bind to different events on the WPF shell side. The code will be a bit different but the principles will remain the same.

You can also use the code as is if you just use the WinForms window as a host for XAML controls. You can do this with the new XAML Islands. This way you can use all of the modern UWP controls inside a WinForm.

How can we do the first, cause I'm trying to include the window class instead form on the Visual Studio Program but that dont' Works. Or know you other .dll able to work with MQL5 and WPF?
 
Hello  VASILIY SOKOLOV

First, thank you very much for your sample and share your idea.

I have download and use it well.

But I have an question it's about why we open the winform in DLL must be use the "MtGuiController.dll"?

Can it possible just import "TradePanel.dll" and use it without "MtGuiController.dll"?

Dose anybody knows how to do it, Thank you.

 

Hello! 

Thanks for your Idea! 

I have build an Form and used a TabelLayoutPanel. But If i now perform a click on a button in this TabelLayoutPanel nothing happens. 

Can someone help me with that?

PS: Same Button works without TabelLayoutPanel.

 
Arturo Minor:

You can use the numeric representation of each Event Type:

Event Type ID
Exception 0
ClickOnElement 1
TextChange 2
ScrollChange 3

Here is an example with SendEvent Function (This code is from TardePanel EA):

You change the representation of the event TextChange for its ID which is 2, and you do this for all the function that need it.


Thanks for the workarround. However, the answer to the original question is still interesting: why is the enumeration not accessible from the EA? The enumeration is declared as public. Why did it work for others? (Or didn't it?)


Thanks in advance for the help.

 
sachnyc:

was anybody able to figure out why there is below error?

The MQL compiler states : "Undeclared Identifier" for any of the enumerations down below.

I am also getting same error.


After a few tests.


To use the constants associated with the enumerations defined in the MtGuiController.dll file is necessary to use the MtGuiController name space before any constant.

For example instead of writing TextChange you have to write MtGuiController.TextChange.

 
Pete:

I'm relative new to MQL5 and I learned a lot from this article! Thanks very much!


I have one question. Have been struggling a bit for the past 2 days to figure this out down below.


I have successfully completed each step a couple of times even on another computer but everytime when I try to compile the code I get an error message.


The MQL compiler states : "Undeclared Identifier" for any of the enumerations down below.


If I "comment" these enumerations out from MQL5 then it works accordingly which is interesting since this means that the code works but can't read the enumerations which is my guess?

If someone can help me I would greatly appreciate :)


Thanks,


After a few tests.


To use the constants associated with the enumerations defined in the MtGuiController.dll file is necessary to use the MtGuiController name space before any constant.

For example instead of writing TextChange you have to write MtGuiController.TextChange.

 

Hello Vasily and hello to all of you. I am using the GuiController which uses a Form created with Visual Studio C #.


The idea was to fill the fields of the ComboBox with data from a SQLite3 DB.


I have installed the whole System.Data.SQLite package but with the GuiController I can't get it to work.


Can anyone explain to me why?


Thanks

 

Hi

I'm wondering if there is an event so that the EA be removed from the chart when the form is closing.

Do I need to change the library?

Any one can help me?

Reason: