fatal error during acedSSGet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I get the following:
FATAL ERROR" Unhandled Access Violation Reading 0xec57407d Exception at 7c93729bh
at the code "result = acedSSGet(NULL, NULL, NULL, rbFilter, WallSS);"
This only happens in the release version. The only way I can tell where is to place a printf statement directly before and after it, and only the one before prints to the command line. The debug version works fine, and even the release version has worked fine for weeks on dozens of drawings. In the offending drawing, the code works on all selected pairs of lines except for the same two specific ones each time. The filter seems to work correctly, as I can see the two lines highlighted as they are selected.
Reopening the drawing has not effect. Also, if I erase and redraw the lines snapping to the same points, I continue to get the fatal error. However, moving the lines to a random location and then running the code apparently eliminates the problem every time, although moving them back to the original coords recreates it. Moving the lines directly down or to the side using polar only helps sometimes.
Does anyone know what might be causing this, or Is there a safer way to call this function?
Code:
// returns a selection set of all lines on a "*_WALL_*" layer,
// with linetype of "BYLAYER"
int WallSelSet(ads_name WallSS)
{
// Build a filter that excludes all except the following:
// 1. Object type = LINE DXF code 0
// 2. Layer contains "_WALL_" DXF code 8
// 3. Linetype value = "BYLAYER" DXF code 6
int result = RTNORM;
struct resbuf *rbFilter = NULL;
rbFilter = acutBuildList(RTDXF0, _T("LINE"),
8, _T("*_WALL_*"),
6, _T("BYLAYER"),
0);
acutPrintf(_T("SelectionSets.cpp 169"));
//obtain the filtered selectionset by user selection
result = acedSSGet(NULL, NULL, NULL, rbFilter, WallSS);
acutPrintf(_T("SelectionSets.cpp 172"));
acutRelRb(rbFilter); //release the result buffer
return result;
}