Author Topic: Attempted to read or write protected memory  (Read 1463 times)

0 Members and 1 Guest are viewing this topic.

cannorth

  • Guest
Attempted to read or write protected memory
« 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                   

n.yuan

  • Bull Frog
  • Posts: 348
Re: Attempted to read or write protected memory
« Reply #1 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.

cannorth

  • Guest
Re: Attempted to read or write protected memory
« Reply #2 on: March 04, 2014, 10:45:03 AM »
There were more lines of code in between the two of them.

Thanks,

cannorth