ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

wblock function returns eVetoed

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
506 Views, 2 Replies

wblock function returns eVetoed

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.

 

 

2 REPLIES 2
Message 2 of 3
owenwengerd
in reply to: Anonymous

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
Message 3 of 3
Anonymous
in reply to: Anonymous

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

#include <axlock.h>

... 

AcAxDocLock docLock(pCurDb); 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost