phollosun 发表于 2006-8-17 09:55:00

如何使用Transaction Reactor?

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

shinjikun 发表于 2006-8-30 14:16:00

AsdkTransactionReactor自然只有在使用transaction的时候才起作用,一般的画图用不到Transaction的
页: [1]
查看完整版本: 如何使用Transaction Reactor?