AcEditorReactor doesn't work if ACRX_CONS_DEFINE_MEMBE used

AcEditorReactor doesn't work if ACRX_CONS_DEFINE_MEMBE used

Anonymous
Not applicable
924 Views
4 Replies
Message 1 of 5

AcEditorReactor doesn't work if ACRX_CONS_DEFINE_MEMBE used

Anonymous
Not applicable
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
0 Likes
925 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Jerry:

Just a hunch, but make sure you 'Rebuild All' after making the change. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 3 of 5

Anonymous
Not applicable
Yes. I "Clean" and "Rebuild All" and am sure I "Appload" the right .arx file. But the virtual methods still don't work if the macros are added.
What do these macors do to the reactor?
0 Likes
Message 4 of 5

Anonymous
Not applicable
Does your code call acrxBuildClassHierarchy() ?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:[email protected]...
Yes. I "Clean" and "Rebuild All" and am sure I "Appload" the right .arx file. But the virtual methods still don't work if the macros are added.
What do these macors do to the reactor?
0 Likes
Message 5 of 5

Anonymous
Not applicable
Thanks, Tony. You are right. After I added the following code to the kInitAppMsg case in acrxEntryPoint(...) method, things go right:
AsdkEdEmployeeReactor::rxInit();
acrxBuildClassHierarchy();

I checked the AcRxDbxApp::On_kInitAppMsg(...) virtual method which is called by wizzard generated code in dbxEntryPoint.h file. Both the rxInit() and acrxBuildClassHierarchy() are called.

Thanks again for all your quick replies.
0 Likes