Forum

Invalid Pointer Access error when one class has members that are instances of another class

I have a class library file that contains classes used in the main body of an MT4 EA (MetaEditor 5.00 build 2375). Here I have two classes: The first one {#PivotPoint} has members for index and price of a pivot point. The second class {#ForkDef} holds the parameters of a fork, most of which are

Invalid Pointer Access error for a function using array of a custom class instance

I have a small custom class and I create an array from instances of that class. I need to use a function that adds or updates the elements of that array and I get " Invalid pointer access error" when I call that function. The code is compilable but when started in the MT4 client gives that error

How return a class instance from a function?

I have a custom class in MQL4 and I would like to create a function that returns a instance of it. Here is my code: FracRes* calcFractal(double x, double y, bool x_, bool y_) { FracRes *res = new FracRes(x_, x, y_, y); return res; } class FracRes { private: bool isTop; double Top; bool isBottom;