External Code

External Code

SRSDS
Advisor Advisor
593 Views
2 Replies
Message 1 of 3

External Code

SRSDS
Advisor
Advisor

What would be causing "External Code" to be running some of my routines.

I have breaks points that are hit when they shouldn't be and the call stack just says "External Code" is calling it.

I can also see that some of my code runs on initializing (because of debugging messages written to the editor) but nothing that I can step through to see what is triggering it.

 

I found this on the swamp. http://www.theswamp.org/index.php?topic=13630.15

Maybe this is the answer but I have no idea. And also don't know what a static constructor is.

 

0 Likes
594 Views
2 Replies
Replies (2)
Message 2 of 3

StephenPreston
Alumni
Alumni

Do you have example code to demonstrate what you mean?

 

Off the top of my head, AutoCAD does instantiate your CommandClass (once per document) when your custom command(s) is run if you don't declare your CommandMethodsw as Shared. Could that be what you're seeing?

 

Cheers,

Stephen Preston
Autodesk Developer Network
0 Likes
Message 3 of 3

SRSDS
Advisor
Advisor

Sorry,

 

I thought it was occuring more often than it actually is. It's only occuring on one event though and I don't think it's causing any harm. Repetitively triggered but it doesn't get trapped in a loop unless I am stepping through in the IDE.

 

 

I have a datagridview in a palette and it happens with the CellFormatting event.

 

Private Sub DataGridView1_CellFormatting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting

 

 

 

0 Likes