Posts: 19
Registered: ‎09-02-2003
Message 1 of 1 (126 Views)

Custom entity wrapper – trapping error if DBX is not loaded…

126 Views, 0 Replies
11-20-2006 04:08 AM

I had created a custom entity derived from AcDbEntity in unmanaged C++ using ObjectARX 2007 wizard. I also created a suitable ARX application to draw the custom entity in AutoCAD, just to serve as a proof that my DBX part is coded fully and working fine.

Then I created a managed C++ wrapper for the above said custom entity using mixed mode code. This also went flawless.

Then I created a managed C# application in which I will use this custom entity, through the wrapper and post it to AutoCAD’s database. This too went flawless.

The dependency relationship is like this:

C# UI depends on wrapper. Wrapper depends on DBX.

But my problem is this: I want to have a mechanism that will help me to throw a user friendly message when the dependent module is not loaded. This mechanism is required in the managed application end, to check whether the wrapper is loaded or not. I had successfully done this. The mechanism is also required in the wrapper to handle the exception when the required DBX is not loaded. I am unable to successfully trap this exception.

In the class of acrxEntryPoint.cpp in wrapper I have the InitAppMsg handler:

virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt)
AcRx::AppRetCode retCode =AcRxDbxApp::smileysurprised:n_kInitAppMsg (pkt);

The exception due to unavailability of DBX is thrown at AutoCAD’s screen even before entering these lines of code.

Any idea, how to trap this exception?

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.