This discussion is archived
3 Replies Latest reply: Sep 18, 2013 9:15 AM by BobFinan - Oracle RSS

Attempted to read or write protected memory

a.mofeez Newbie
Currently Being Moderated
 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 .

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points