0

Just to clarify, I have fixed this problem temperately and just wanted to see if someone could expand on why this happened and possibly give me some insight as to how to fix it permanently. I am building a plugin for AutoCAD and have ran into some troubles with some RadioButtons

I set the GroupName property of my a group of RadioButtons so i could control them independently from a different group. Now when I'm debugging in either release and debug mode the application works, but when i netload my .dll into autocad to check how it performs outside of debug mode, I click one of the 8 radio buttons and autocad crashes (Im not worried about that) and i got the exception that it was throwing it is as follows:

the thread tried to read from or write to a virtual address for which it does not have the appropriate access

and part of the code that threw it:

at System.Windows.Controls.RadioButton.UpdateRadioButtonGroup()
at System.Windows.Controls.RadioButton.OnChecked(RoutedEventArgs e)
at System.Windows.Controls.Primitives.ToggleButton.OnIsCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)

Now i really don't understand why it is not working outside of debugging. Can someone please try to give me some insight to this?

As a the temporary fix i removed GroupName from my RadioButton XAML. if you need any of the source please ask.

Trae Moore
  • 1,759
  • 3
  • 17
  • 32
  • Groupname worked? Hmm, sounds like a bug. You might want to open a connect and provide a minimal sample that repros the issue. –  Nov 18 '13 at 21:44
  • @Will I don't understand your question.... Do you think It's a moth? – Trae Moore Nov 18 '13 at 21:46
  • Is your program attempting to perform some action within AutoCAD when you select a radio button? or is selecting the radio button a precursor to something else? – Lee Harrison Nov 18 '13 at 22:12
  • When i select the Radiobutton it sorts a list in my ViewModel. – Trae Moore Nov 18 '13 at 22:14

2 Answers2

0

I didn't get the issue fixed directly. But, as a work around, I put them in their own grid. This gave me the results I was looking for.

Trae Moore
  • 1,759
  • 3
  • 17
  • 32
0

If you are showing your wpf view in a palette, try setting the session flag on the command to Session.

Example:

CommandMethod("CommandName",CommandFlags.Session)] public void Something() { //Your code }