Message 1 of 5
AcEditorReactor doesn't work if ACRX_CONS_DEFINE_MEMBE used
Not applicable
06-06-2007
08:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I am writing sample codes in AutoCAD 2008 debug environment without using ObjectARX Wizard. I am just creating a dll with .arx extension.
A reactor class named AsdkEdEmployeeReactor is created as a common c++ class. It inherits AcEditorReactor. The constructor is:
if ( autoInitAndRelease ) {
if ( acedEditor )
acedEditor->addReactor (this) ;
else
mbAutoInitAndRelease =false ;
2 virtual methods - commandWillStart and commandEnded implemented.
In acrxEntryPoint(...) method, a reactor object is created and added:
pEdEmployeeReactor = new AsdkEdEmployeeReactor(true);
Everything works fine in these simple ways. And the commandWillStart and commandEnded can be called when the user run commands. But if the ACRX_DECLARE_MEMBERS(AsdkEdEmployeeReactor) and ACRX_CONS_DEFINE_MEMBERS(AsdkEdEmployeeReactor, AcEditorReactor, 0) are added the the class, the 2 virtual methods will not be invoked when commands are run. And this is the way the ObjectARX Wizard does when creating reactor class - the 2 macros will be added.
This situation only happens on AcEditorReactor subclasses as I found. Those classes inheriting from AcDbDatabaseReactor and AcDbObjectReactor works well in spite of whether macros are added or not.
Any information about that?
Thanks.
Jerry
I am writing sample codes in AutoCAD 2008 debug environment without using ObjectARX Wizard. I am just creating a dll with .arx extension.
A reactor class named AsdkEdEmployeeReactor is created as a common c++ class. It inherits AcEditorReactor. The constructor is:
if ( autoInitAndRelease ) {
if ( acedEditor )
acedEditor->addReactor (this) ;
else
mbAutoInitAndRelease =false ;
2 virtual methods - commandWillStart and commandEnded implemented.
In acrxEntryPoint(...) method, a reactor object is created and added:
pEdEmployeeReactor = new AsdkEdEmployeeReactor(true);
Everything works fine in these simple ways. And the commandWillStart and commandEnded can be called when the user run commands. But if the ACRX_DECLARE_MEMBERS(AsdkEdEmployeeReactor) and ACRX_CONS_DEFINE_MEMBERS(AsdkEdEmployeeReactor, AcEditorReactor, 0) are added the the class, the 2 virtual methods will not be invoked when commands are run. And this is the way the ObjectARX Wizard does when creating reactor class - the 2 macros will be added.
This situation only happens on AcEditorReactor subclasses as I found. Those classes inheriting from AcDbDatabaseReactor and AcDbObjectReactor works well in spite of whether macros are added or not.
Any information about that?
Thanks.
Jerry