如何使用Transaction Reactor?
<P>我先定义了AcTransactionReactor的一个子类:</P><P>class AsdkTransactionReactor : public AcTransactionReactor<BR>{<BR>public:<BR> virtual void transactionStarted(int& numTransactions, AcDbTransactionManager* transactionManagerPtr);<BR> virtual void transactionAborted(int& numTransactions, AcDbTransactionManager* transactionManagerPtr);<BR> virtual void transactionEnded(int& numTransactions, AcDbTransactionManager* transactionManagerPtr);</P>
<P>};</P>
<P>void AsdkTransactionReactor::transactionEnded(int& numTransactions, AcDbTransactionManager* transactionManagerPtr)<BR>{<BR><BR> acutPrintf(_T("Transaction Ended\n"));<BR><BR>}</P>
<P>void AsdkTransactionReactor::transactionStarted(int& numTransactions, AcDbTransactionManager* transactionManagerPtr)<BR>{<BR> acutPrintf(_T("Transaction Started\n"));<BR>}</P>
<P>void AsdkTransactionReactor::transactionAborted(int& numTransactions, AcDbTransactionManager* transactionManagerPtr)<BR>{</P>
<P> acutPrintf(_T("Transaction Aborted\n"));</P>
<P>}</P>
<P>接着在初始化程序时:</P>
<P>AsdkTransactionReactor* gpTsr = new AsdkTransactionReactor();</P>
<P>actrTransactionManager->addReactor(gpTsr);</P>
<P>在AutoCAD中导入这个arx后,无论怎么画图这个AsdkTransactionReactor都没有反应啊!</P>
<P>程序有没有什么问题?</P> AsdkTransactionReactor自然只有在使用transaction的时候才起作用,一般的画图用不到Transaction的
页:
[1]