use FileWriteArray() to write an Aarray of custom struct - ERROR structures or classes containing objects are not allowed

 

Hi, I have this fuction to write an array to the file :

void WriteData()
  {
//--- open the file
   ResetLastError();
   int handle=FileOpen(path,FILE_READ|FILE_WRITE|FILE_BIN);
   if(handle!=INVALID_HANDLE)
     {
      //--- write array data to the end of the file
      FileSeek(handle,0,SEEK_END);
      FileWriteArray(handle,Pending_order_list,0,ArraySize(Pending_order_list));
      //--- close the file
      FileClose(handle);
     }
   else
      Print("Failed to open the file, error ",GetLastError());
  }

Pending_order_list is an array of this struct :

struct PendingOrderInfo
{
    int account;
    double sl, tp1, tp2, tp3, tp4;
    string symbol;
    double price;
    string type;
    double volume;
    datetime orderPlacementTime;
    ulong ticket;
    bool isBreakEven;
    bool isRiskFree;
    bool isTP1;
    bool isTP2;
    bool isTP3;
    bool isTP4;
    double priceToBearkEven;

    PendingOrderInfo()
    {
        account = NULL;
        sl = NULL;
        tp1 = NULL;
        tp2 = NULL;
        tp3 = NULL;
        tp4 = NULL;
        symbol = NULL;
        price = NULL;
        type = NULL;
        volume = NULL;
        ticket = NULL;
        isBreakEven = false;
        isRiskFree = false;
        isTP1 = false;
        isTP2 = false;
        isTP3 = false;
        isTP4 = false;
        priceToBearkEven = NULL;
    }
    ~PendingOrderInfo() {}
};

PendingOrderInfo Pending_order_list[];

on complie I got this error : structures or classes containing objects are not allowed

but struct has only general variables, where I'm doing it wrong ?

 
biglibigli7476:


but struct has only general variables, where I'm doing it wrong ?

string is an object.