- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
If I have a function called 'linedraw' whose purpose is to create an 'acdb' object, and that function runs on a different thread using std::thread, I encounter an error with an 'Unhandled Access Violation Reading' message. The primary goal of running this function on a separate thread is to prevent it from blocking the main AutoCAD application. However, when I attempt to call this function inside the ARX entry point as follows:
....
case AcRx::kInitAppMsg:
std::thread(linedraw).detach(); // !!!!!!!
break;
etc...
I encounter the mentioned error. My intention is to avoid blocking the main AutoCAD app, especially when dealing with functions that may run indefinitely, such as calculations. Is there a solution for this scenario? Additionally, if I have the 'linedraw' function that should be triggered automatically (not from the command window) and can be initiated from another void() function or an external UI, is there a way to achieve this without causing the AutoCAD application to become unresponsive?
Solved! Go to Solution.