wblock function returns eVetoed

wblock function returns eVetoed

Anonymous
Not applicable
631 Views
2 Replies
Message 1 of 3

wblock function returns eVetoed

Anonymous
Not applicable

Hi,

 

In my ObjectARX application, I am trying to copy the entities from current drawing into a target drawing. For this, I am using AcDbDatabase::wblock function but it returns me error status as eVetoed. Following is extract of my code:

 

AcDbDatabase pFlatDb = new AcDbDatabase(true, true);

AcDbObjectIdArray tmpArray;

-- //some code to populate tmpArray

--

//pCurDb is current database

Acad::ErrorStatus es = pCurDb->wblock(pFlatDb, tmpArray, AcGePoint3d::kOrigin, AcDb::kDrcIgnore);

if(Acad::eOk != es)

{

acutPrintf(L"\nFailed to copy geometry into new drawing: %s", acadErrorStatusText(es));

delete pFlatDb;

return;

}

 

The application crashes at the line where I delete the target database (delete pFlatDb).

 

Am I doing something wrong here? What could be the reason for return status eVetoed and how to handle this situation so that crash does not occur?

 

Thanks in advance.

 

 

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

owenwengerd
Advisor
Advisor

You don't say here what context your code is executing in when the problem occurs, but that is likely a factor. I recommend to try testing this code in a standard command handler function in a simple module with no reactors or other add-ons loaded, then add things until the error occurs.

--
Owen Wengerd
ManuSoft
0 Likes
Message 3 of 3

Anonymous
Not applicable

try to lock current database at the beginning of your function.

#include <axlock.h>

... 

AcAxDocLock docLock(pCurDb); 

0 Likes