2018-01-10 02:58 UTC
Hi there,
I'm working on a project that I wrote a long time ago. I recently added a button to my dialog and my program crashes when I use it. The program has several buttons that do various things in AutoCAD. Each button still works except the new one. Each button calls the same function that:
--sets a global "flag" to true
--save some info on the form to a global variable
--closes the dialog
--does a variety of things based on the arguments passed by the calling function (the button events).
The function called by the bad button works to a point. I removed the complicated code and replaced it with something simple so I could see if it's working:
(alert "3")
(command "zoom" "e" )
The alert works but the zoom does NOT. Stepping through the program, it turns out the dialog returns immediately after the zoom. If I push any buttons when the dialog returns it crashes with the message, "FATAL ERROR: Unhandled Access Violation Reading 0x0010 Exception at 8d7f3ab9h"
It seems like I'm forgetting something. I was looking in the documentation because I remembered the bit about setting the flag and closing the dialog...but I couldn't find anything about this topic. Are commands not allowed when dialog is suspended?
I'm working on a project that I wrote a long time ago. I recently added a button to my dialog and my program crashes when I use it. The program has several buttons that do various things in AutoCAD. Each button still works except the new one. Each button calls the same function that:
--sets a global "flag" to true
--save some info on the form to a global variable
--closes the dialog
--does a variety of things based on the arguments passed by the calling function (the button events).
The function called by the bad button works to a point. I removed the complicated code and replaced it with something simple so I could see if it's working:
(alert "3")
(command "zoom" "e" )
The alert works but the zoom does NOT. Stepping through the program, it turns out the dialog returns immediately after the zoom. If I push any buttons when the dialog returns it crashes with the message, "FATAL ERROR: Unhandled Access Violation Reading 0x0010 Exception at 8d7f3ab9h"
It seems like I'm forgetting something. I was looking in the documentation because I remembered the bit about setting the flag and closing the dialog...but I couldn't find anything about this topic. Are commands not allowed when dialog is suspended?