Stack overflow strange error

 

I have a strage problem.I call a code from an script and works fine and if i call from am EA i have 'stack overflow' error.

What causes this problem?


//Later

I recive stack overflow error on OrderSend function.

Documentation on MQL5: Trade Functions / OrderSend
  • www.mql5.com
Trade Functions / OrderSend - Documentation on MQL5
 

Recursive calls?

 
Yes, i call OrderSend function for eatch positions.
Documentation on MQL5: Trade Functions / OrderSend
  • www.mql5.com
Trade Functions / OrderSend - Documentation on MQL5
 
dudufx:

Yes, i call OrderSend function for eatch positions.
You can see sample of a recursive call here - https://www.mql5.com/en/docs/common/gettickcount
Documentation on MQL5: Common Functions / GetTickCount
  • www.mql5.com
Common Functions / GetTickCount - Documentation on MQL5
 
No Rosh, my pal got it wrong, the function with OrderSend is NOT recursive. I can't tell why it generates the stack overflow. If it moves the function block inside the caller, there is no error anymore.
 
Yo had better to write to Servicedesk with source code.
Get in touch with developers using Service Desk!
  • www.mql5.com
We therefore attach great importance to all user reports about issues in our programs and try to answer each one of them.
 
TheEconomist:
No Rosh, my pal got it wrong, the function with OrderSend is NOT recursive. I can't tell why it generates the stack overflow. If it moves the function block inside the caller, there is no error anymore.

pure recursive call

void CTrade::OrderSend(MqlTradeRequest &request,MqlTradeResult &results)
{
   OrderSend(request,results);
}

right call

void CTrade::OrderSend(MqlTradeRequest &request,MqlTradeResult &results)
{
   ::OrderSend(request,results);
}

See scope resolution operation 

Reason: