我先定义了AcTransactionReactor的一个子类:
class AsdkTransactionReactor : public AcTransactionReactor { public: virtual void transactionStarted(int& numTransactions, AcDbTransactionManager* transactionManagerPtr); virtual void transactionAborted(int& numTransactions, AcDbTransactionManager* transactionManagerPtr); virtual void transactionEnded(int& numTransactions, AcDbTransactionManager* transactionManagerPtr);
};
void AsdkTransactionReactor::transactionEnded(int& numTransactions, AcDbTransactionManager* transactionManagerPtr) {
acutPrintf(_T("Transaction Ended\n"));
}
void AsdkTransactionReactor::transactionStarted(int& numTransactions, AcDbTransactionManager* transactionManagerPtr) { acutPrintf(_T("Transaction Started\n")); }
void AsdkTransactionReactor::transactionAborted(int& numTransactions, AcDbTransactionManager* transactionManagerPtr) {
acutPrintf(_T("Transaction Aborted\n"));
}
接着在初始化程序时:
AsdkTransactionReactor* gpTsr = new AsdkTransactionReactor();
actrTransactionManager->addReactor(gpTsr);
在AutoCAD中导入这个arx后,无论怎么画图这个AsdkTransactionReactor都没有反应啊!
程序有没有什么问题? |