3 Replies Latest reply: Sep 18, 2013 11:15 AM by Bobfinan - Oracle-Oracle RSS

    Attempted to read or write protected memory

    a.mofeez
      
       fmlSendbuff = new TypedFML32(10000);
      
      TypedBuffer fmlRecvbuff = new TypedFML32(10000);
      
      AppContext ac = null;
      
      
      
      try
      {
      
      
      
      TypedTPINIT tpinfo = new TypedTPINIT(512);
      
      
      AppContext.tpinit(tpinfo);
      
      
      
      
      
      
      
       fmlSendbuff.Fadd(TypedFML32.Fmkfldid(FieldType.FLD_STRING, 1), input);
      
      
      
      
      object retValue;
      
      
      FLDOCC oc = new FLDOCC(0);
      
      
      
      ac.tpcall("Test", (TypedBuffer)fmlSendbuff, ref fmlRecvbuff, 0);
      
      
      
      
      
      
      
      ((TypedFML32)fmlRecvbuff).Fget(TypedFML32.Fmkfldid(FieldType.FLD_STRING, 31), oc, out retValue);
      string output = retValue.ToString();
      
      
      
      
      fmlSendbuff.Dispose();
      fmlRecvbuff.Dispose();
      ac.tpterm();
      }
      
      
      catch (Exception ex)
      
      {
      fmlSendbuff.Dispose();
      
      fmlRecvbuff.Dispose();
      
      ac.tpterm();
      
      }
      
      
      
      
      
      
      
      
      
      
      
      
      
      

       

      when try first time it is ok , second call without close the application show this error :

      Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

       

      when execute function tpcall or tpterm .

       

      thanks .