Author Topic: How to P/Invoke acdbGetCurVportTableRecordId for AutoCAD 2008?  (Read 1704 times)

0 Members and 1 Guest are viewing this topic.

csharpbird

  • Newt
  • Posts: 64
How to P/Invoke acdbGetCurVportTableRecordId for AutoCAD 2008?
« on: January 07, 2012, 11:45:56 PM »
Code: [Select]
[DllImport("acdb17.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "?acdbGetCurVportTableRecordId@@YA?AVAcDbObjectId@@PAVAcDbDatabase@@@Z")]
        private extern static ObjectId acdbGetCurVportTableRecordId(IntPtr dbObject);
        public static ObjectId CurrentViewportTableRecordId(this Database db)
        {
            return acdbGetCurVportTableRecordId(db.UnmanagedObject);
        }
When i call the CurrentViewportTableRecordId function,I get System.AccessViolationException exception.
Any help?