TheSwamp

Code Red => .NET => Topic started by: cannorth on February 19, 2014, 11:10:27 AM

Title: Attempted to read or write protected memory
Post by: cannorth on February 19, 2014, 11:10:27 AM
Hello,

  I have the read or write protected memory problem for this line of code:

Code: [Select]
Dim id As ObjectId, tbl1 As ObjectData.Table, records1 As ObjectData.Records
 records1 = tbl1.GetObjectTableRecords(Convert.ToUInt32(0), id, Constants.OpenMode.OpenForWrite, False)
   

  Where's the best place to start debugging this problem?

Thanks,

cannorth                   
Title: Re: Attempted to read or write protected memory
Post by: n.yuan on February 19, 2014, 02:52:48 PM
Were there a few lines of code between the 2 lines of code you showed omitted?

If not, then the "id" passed into the GetObjectTableRecords() method is not a valid ObjectId of an entity, thus the error.
Title: Re: Attempted to read or write protected memory
Post by: cannorth on March 04, 2014, 10:45:03 AM
There were more lines of code in between the two of them.

Thanks,

cannorth