assertWriteEnabled causes error even though isWriteEnabled() returns true?

assertWriteEnabled causes error even though isWriteEnabled() returns true?

Anonymous
Not applicable
583 Views
2 Replies
Message 1 of 3

assertWriteEnabled causes error even though isWriteEnabled() returns true?

Anonymous
Not applicable
Hi again,

Can anyone help?

Here's what I'm doing

1) Lock the document for writing
2) I open an object from an entity's extension dictionary for kWrite
3) Try casting it to various classes using ::cast(p) to determine the class.
4) Use a setXXXX method of that class to try to set one of the properties

On executing assertWriteEnabled in this method I get this error message:
Fatal Error Unhandled Access Violation error reading 0x0000 Exception at
671c0e94h.

isWriteEnabled directly before the assertWriteEnabled verifies that the
object is open for write.

Does anyone have any thoughts?
Thanks in advance, (most deeply appreciated since this will be a real
sticking point) 🙂

Best regards,
Andrew Hoadley
Cavsoft
0 Likes
584 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
assertWriteEnabled() sets up the undo pipeline and, for an entity, sets the
graphics modified bit on the object. If you are the first argument to
assertWriteEnabled() is true (the default), then a full undo recording of
the object's current state will also be recorded. This is done via a call
to the object's dwgOutFields() method using an undo filer. So, if there's
something wrong in the undo pipeline or in your object's dwgOutFields()
method, then that could cause the problem.

"Andrew Hoadley" wrote in message
news:[email protected]...
> Hi again,
>
> Can anyone help?
>
> Here's what I'm doing
>
> 1) Lock the document for writing
> 2) I open an object from an entity's extension dictionary for kWrite
> 3) Try casting it to various classes using ::cast(p) to determine the
class.
> 4) Use a setXXXX method of that class to try to set one of the properties
>
> On executing assertWriteEnabled in this method I get this error message:
> Fatal Error Unhandled Access Violation error reading 0x0000 Exception at
> 671c0e94h.
>
> isWriteEnabled directly before the assertWriteEnabled verifies that the
> object is open for write.
>
> Does anyone have any thoughts?
> Thanks in advance, (most deeply appreciated since this will be a real
> sticking point) 🙂
>
> Best regards,
> Andrew Hoadley
> Cavsoft
>
>
0 Likes
Message 3 of 3

Anonymous
Not applicable
Hi Art

Thank you!! That's a great help! 🙂

Andrew

"Art Cooney" wrote in message
news:[email protected]...
> assertWriteEnabled() sets up the undo pipeline and, for an entity, sets
the
> graphics modified bit on the object. If you are the first argument to
> assertWriteEnabled() is true (the default), then a full undo recording of
> the object's current state will also be recorded. This is done via a call
> to the object's dwgOutFields() method using an undo filer. So, if there's
> something wrong in the undo pipeline or in your object's dwgOutFields()
> method, then that could cause the problem.
>
> "Andrew Hoadley" wrote in message
> news:[email protected]...
> > Hi again,
> >
> > Can anyone help?
> >
> > Here's what I'm doing
> >
> > 1) Lock the document for writing
> > 2) I open an object from an entity's extension dictionary for kWrite
> > 3) Try casting it to various classes using ::cast(p) to determine the
> class.
> > 4) Use a setXXXX method of that class to try to set one of the
properties
> >
> > On executing assertWriteEnabled in this method I get this error message:
> > Fatal Error Unhandled Access Violation error reading 0x0000 Exception at
> > 671c0e94h.
> >
> > isWriteEnabled directly before the assertWriteEnabled verifies that the
> > object is open for write.
> >
> > Does anyone have any thoughts?
> > Thanks in advance, (most deeply appreciated since this will be a real
> > sticking point) 🙂
> >
> > Best regards,
> > Andrew Hoadley
> > Cavsoft
> >
> >
>
>
0 Likes